@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 |
private ArrayList<Cell> |
cells |
static byte[] |
COMPACTION |
private CompressionContext |
compressionContext |
static WALEdit |
EMPTY_WALEDIT |
static byte[] |
FLUSH |
private boolean |
isReplay |
private static org.apache.commons.logging.Log |
LOG |
static byte[] |
METAFAMILY |
static byte[] |
METAROW |
static byte[] |
REGION_EVENT |
private NavigableMap<byte[],Integer> |
scopes
Deprecated.
Legacy
|
private int |
VERSION_2 |
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) |
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) |
private static final org.apache.commons.logging.Log LOG
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
private final int VERSION_2
private final boolean isReplay
public static final WALEdit EMPTY_WALEDIT
@Deprecated private NavigableMap<byte[],Integer> scopes
private CompressionContext compressionContext
public static boolean isMetaEditFamily(byte[] f)
f
- f
is METAFAMILY
public 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.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public int readFromCells(Codec.Decoder cellDecoder, int expectedCount) throws IOException
cellDecoder
- Cell decoder.expectedCount
- Expected cell count.IOException
public long heapSize()
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
IOException
public 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
IOException
public 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 valueIOException
public static boolean isCompactionMarker(Cell cell)
WALProtos.CompactionDescriptor
getCompaction(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 valueIOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.