@InterfaceAudience.LimitedPrivate(value={"Replication","Coprocesssor"}) public class WALEdit extends Object implements org.apache.hadoop.io.Writable, HeapSize
| Modifier and Type | Field and Description |
|---|---|
static byte[] |
BULK_LOAD |
static byte[] |
COMPACTION |
static WALEdit |
EMPTY_WALEDIT |
static byte[] |
FLUSH |
static byte[] |
METAFAMILY |
static byte[] |
METAROW |
static byte[] |
REGION_EVENT |
| Constructor and Description |
|---|
WALEdit() |
WALEdit(boolean isReplay) |
WALEdit(int cellCount) |
WALEdit(int cellCount,
boolean isReplay) |
| Modifier and Type | Method and Description |
|---|---|
WALEdit |
add(Cell cell) |
static WALEdit |
createBulkLoadEvent(HRegionInfo hri,
org.apache.hadoop.hbase.protobuf.generated.WALProtos.BulkLoadDescriptor bulkLoadDescriptor)
Create a bulk loader WALEdit
|
static WALEdit |
createCompaction(HRegionInfo hri,
org.apache.hadoop.hbase.protobuf.generated.WALProtos.CompactionDescriptor c)
Create a compaction WALEdit
|
static WALEdit |
createFlushWALEdit(HRegionInfo hri,
org.apache.hadoop.hbase.protobuf.generated.WALProtos.FlushDescriptor f) |
static WALEdit |
createRegionEventWALEdit(HRegionInfo hri,
org.apache.hadoop.hbase.protobuf.generated.WALProtos.RegionEventDescriptor regionEventDesc) |
long |
estimatedSerializedSizeOf() |
NavigableMap<byte[],Integer> |
getAndRemoveScopes() |
static org.apache.hadoop.hbase.protobuf.generated.WALProtos.BulkLoadDescriptor |
getBulkLoadDescriptor(Cell cell)
Deserialized and returns a BulkLoadDescriptor from the passed in Cell
|
ArrayList<Cell> |
getCells() |
static org.apache.hadoop.hbase.protobuf.generated.WALProtos.CompactionDescriptor |
getCompaction(Cell kv)
Deserialized and returns a CompactionDescriptor is the KeyValue contains one.
|
static org.apache.hadoop.hbase.protobuf.generated.WALProtos.FlushDescriptor |
getFlushDescriptor(Cell cell) |
static org.apache.hadoop.hbase.protobuf.generated.WALProtos.RegionEventDescriptor |
getRegionEventDescriptor(Cell cell) |
static byte[] |
getRowForRegion(HRegionInfo hri) |
long |
heapSize() |
static boolean |
isCompactionMarker(Cell cell)
Returns true if the given cell is a serialized
WALProtos.CompactionDescriptor |
boolean |
isEmpty() |
boolean |
isMetaEdit() |
static boolean |
isMetaEditFamily(byte[] f) |
static boolean |
isMetaEditFamily(Cell cell) |
boolean |
isReplay() |
void |
readFields(DataInput in) |
int |
readFromCells(Codec.Decoder cellDecoder,
int expectedCount)
Reads WALEdit from cells.
|
void |
setCells(ArrayList<Cell> cells)
This is not thread safe.
|
void |
setCompressionContext(CompressionContext compressionContext) |
int |
size() |
String |
toString() |
void |
write(DataOutput out) |
public static final byte[] METAFAMILY
public static final byte[] METAROW
public static final byte[] COMPACTION
public static final byte[] FLUSH
public static final byte[] REGION_EVENT
public static final byte[] BULK_LOAD
public static final WALEdit EMPTY_WALEDIT
public WALEdit()
public WALEdit(boolean isReplay)
public WALEdit(int cellCount)
public WALEdit(int cellCount,
boolean isReplay)
public static boolean isMetaEditFamily(byte[] f)
f - f is METAFAMILYpublic static boolean isMetaEditFamily(Cell cell)
public boolean isMetaEdit()
public boolean isReplay()
public void setCompressionContext(CompressionContext compressionContext)
public boolean isEmpty()
public int size()
@InterfaceAudience.Private public void setCells(ArrayList<Cell> cells)
cells - the list of cells that this WALEdit now contains.public NavigableMap<byte[],Integer> getAndRemoveScopes()
public void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionpublic void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic int readFromCells(Codec.Decoder cellDecoder, int expectedCount) throws IOException
cellDecoder - Cell decoder.expectedCount - Expected cell count.IOExceptionpublic long heapSize()
public long estimatedSerializedSizeOf()
public static WALEdit createFlushWALEdit(HRegionInfo hri, org.apache.hadoop.hbase.protobuf.generated.WALProtos.FlushDescriptor f)
public static org.apache.hadoop.hbase.protobuf.generated.WALProtos.FlushDescriptor getFlushDescriptor(Cell cell) throws IOException
IOExceptionpublic static WALEdit createRegionEventWALEdit(HRegionInfo hri, org.apache.hadoop.hbase.protobuf.generated.WALProtos.RegionEventDescriptor regionEventDesc)
public static org.apache.hadoop.hbase.protobuf.generated.WALProtos.RegionEventDescriptor getRegionEventDescriptor(Cell cell) throws IOException
IOExceptionpublic static WALEdit createCompaction(HRegionInfo hri, org.apache.hadoop.hbase.protobuf.generated.WALProtos.CompactionDescriptor c)
c - c serialized as its valuepublic static byte[] getRowForRegion(HRegionInfo hri)
public static org.apache.hadoop.hbase.protobuf.generated.WALProtos.CompactionDescriptor getCompaction(Cell kv) throws IOException
kv - the key valueIOExceptionpublic static boolean isCompactionMarker(Cell cell)
WALProtos.CompactionDescriptorgetCompaction(Cell)public static WALEdit createBulkLoadEvent(HRegionInfo hri, org.apache.hadoop.hbase.protobuf.generated.WALProtos.BulkLoadDescriptor bulkLoadDescriptor)
hri - The HRegionInfo for the region in which we are bulk loadingbulkLoadDescriptor - The descriptor for the Bulk Loaderpublic static org.apache.hadoop.hbase.protobuf.generated.WALProtos.BulkLoadDescriptor getBulkLoadDescriptor(Cell cell) throws IOException
cell - the key valueIOExceptionCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.