.
The deserializer for WALEdit backward compatibly detects if the record
is an old style KeyValue or the new style WALEdit.
Field Summary |
static org.apache.commons.logging.Log |
LOG
|
static byte[] |
METAFAMILY
|
LOG
public static final org.apache.commons.logging.Log LOG
METAFAMILY
public static final byte[] METAFAMILY
WALEdit
public WALEdit()
WALEdit
public WALEdit(boolean isReplay)
isMetaEditFamily
public static boolean isMetaEditFamily(byte[] f)
- Parameters:
f
-
- Returns:
- True is
f
is METAFAMILY
isReplay
public boolean isReplay()
- Returns:
- True when current WALEdit is created by log replay. Replication skips WALEdits from
replay.
setCompressionContext
public void setCompressionContext(org.apache.hadoop.hbase.regionserver.wal.CompressionContext compressionContext)
add
@Deprecated
public WALEdit add(KeyValue kv)
- Deprecated. Use
add(Cell)
instead
- Adds a KeyValue to this edit
- Parameters:
kv
-
- Returns:
- this for chained action
add
public WALEdit add(Cell cell)
- Adds a Cell to this edit
- Parameters:
cell
-
- Returns:
- this for chained action
isEmpty
public boolean isEmpty()
size
public int size()
getKeyValues
@Deprecated
public ArrayList<KeyValue> getKeyValues()
- Deprecated. Use
getCells()
instead
- Returns:
- The KeyValues associated with this edit
getCells
public ArrayList<Cell> getCells()
- Returns:
- The Cells associated with this edit
getAndRemoveScopes
public NavigableMap<byte[],Integer> getAndRemoveScopes()
readFields
public void readFields(DataInput in)
throws IOException
- Specified by:
readFields
in interface org.apache.hadoop.io.Writable
- Throws:
IOException
write
public void write(DataOutput out)
throws IOException
- Specified by:
write
in interface org.apache.hadoop.io.Writable
- Throws:
IOException
readFromCells
public int readFromCells(Codec.Decoder cellDecoder,
int expectedCount)
throws IOException
- Reads WALEdit from cells.
- Parameters:
cellDecoder
- Cell decoder.expectedCount
- Expected cell count.
- Returns:
- Number of KVs read.
- Throws:
IOException
heapSize
public long heapSize()
- Specified by:
heapSize
in interface HeapSize
- Returns:
- Approximate 'exclusive deep size' of implementing object. Includes
count of payload and hosting object sizings.
toString
public String toString()
- Overrides:
toString
in class Object
createCompaction
public static WALEdit createCompaction(HRegionInfo hri,
WALProtos.CompactionDescriptor c)
- Create a compacion WALEdit
- Parameters:
c
-
- Returns:
- A WALEdit that has
c
serialized as its value
getCompaction
public static WALProtos.CompactionDescriptor getCompaction(Cell kv)
throws IOException
- Deserialized and returns a CompactionDescriptor is the KeyValue contains one.
- Parameters:
kv
- the key value
- Returns:
- deserialized CompactionDescriptor or null.
- Throws:
IOException
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.