Search in sources :

Example 6 with WriteEntry

use of org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl.WriteEntry in project hbase by apache.

the class HRegion method doWALAppend.

/**
   * @return writeEntry associated with this append
   */
private WriteEntry doWALAppend(WALEdit walEdit, Durability durability, List<UUID> clusterIds, long now, long nonceGroup, long nonce) throws IOException {
    WriteEntry writeEntry = null;
    // Using default cluster id, as this can only happen in the originating cluster.
    // A slave cluster receives the final value (not the delta) as a Put. We use HLogKey
    // here instead of WALKey directly to support legacy coprocessors.
    WALKey walKey = new WALKey(this.getRegionInfo().getEncodedNameAsBytes(), this.htableDescriptor.getTableName(), WALKey.NO_SEQUENCE_ID, now, clusterIds, nonceGroup, nonce, mvcc, this.getReplicationScope());
    try {
        long txid = this.wal.append(this.getRegionInfo(), walKey, walEdit, true);
        // Call sync on our edit.
        if (txid != 0)
            sync(txid, durability);
        writeEntry = walKey.getWriteEntry();
    } catch (IOException ioe) {
        if (walKey != null)
            mvcc.complete(walKey.getWriteEntry());
        throw ioe;
    }
    return writeEntry;
}
Also used : WALKey(org.apache.hadoop.hbase.wal.WALKey) WriteEntry(org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl.WriteEntry) InterruptedIOException(java.io.InterruptedIOException) IOException(java.io.IOException) MultipleIOException(org.apache.hadoop.io.MultipleIOException) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException) TimeoutIOException(org.apache.hadoop.hbase.exceptions.TimeoutIOException)

Aggregations

WriteEntry (org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl.WriteEntry)6 ArrayList (java.util.ArrayList)4 IOException (java.io.IOException)3 InterruptedIOException (java.io.InterruptedIOException)3 AbstractList (java.util.AbstractList)3 HashMap (java.util.HashMap)3 List (java.util.List)3 TreeMap (java.util.TreeMap)3 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)3 Cell (org.apache.hadoop.hbase.Cell)3 DoNotRetryIOException (org.apache.hadoop.hbase.DoNotRetryIOException)3 TimeoutIOException (org.apache.hadoop.hbase.exceptions.TimeoutIOException)3 WALEdit (org.apache.hadoop.hbase.regionserver.wal.WALEdit)3 MultipleIOException (org.apache.hadoop.io.MultipleIOException)3 Map (java.util.Map)2 NavigableMap (java.util.NavigableMap)2 ConcurrentMap (java.util.concurrent.ConcurrentMap)2 ConcurrentSkipListMap (java.util.concurrent.ConcurrentSkipListMap)2 Durability (org.apache.hadoop.hbase.client.Durability)2 Mutation (org.apache.hadoop.hbase.client.Mutation)2