@InterfaceAudience.LimitedPrivate(value={"Replication","Coprocesssor"}) public class WALEdit extends Object implements HeapSize
This class is LimitedPrivate for CPs to read-only. The add(org.apache.hadoop.hbase.Cell, byte[])
methods are
classified as private methods, not for use by CPs.
WALEdit will accumulate a Set of all column family names referenced by the Cells
add(Cell)
'd. This is an optimization. Usually when loading a WALEdit, we have the
column family name to-hand.. just shove it into the WALEdit if available. Doing this, we can
save on a parse of each Cell to figure column family down the line when we go to add the
WALEdit to the WAL file. See the hand-off in FSWALEntry Constructor.
Modifier and Type | Field and Description |
---|---|
static byte[] |
BULK_LOAD |
static byte[] |
COMPACTION |
static byte[] |
FLUSH |
static byte[] |
METAFAMILY |
static byte[] |
METAROW |
static byte[] |
REGION_EVENT |
Constructor and Description |
---|
WALEdit() |
WALEdit(boolean isReplay)
Deprecated.
Since 2.0.1. Use
WALEdit(int, boolean) instead. |
WALEdit(int cellCount)
Deprecated.
Since 2.0.1. Use
WALEdit(int, boolean) instead. |
WALEdit(int cellCount,
boolean isReplay) |
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 WALEdit()
@Deprecated public WALEdit(boolean isReplay)
WALEdit(int, boolean)
instead.@Deprecated public WALEdit(int cellCount)
WALEdit(int, boolean)
instead.public WALEdit(int cellCount, boolean isReplay)
cellCount
- Pass so can pre-size the WALEdit. Optimization.public Set<byte[]> getFamilies()
getCells()
; may be null.public static boolean isMetaEditFamily(byte[] f)
f
is METAFAMILY
public static boolean isMetaEditFamily(Cell cell)
public boolean isMetaEdit()
public boolean isReplay()
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 int readFromCells(Codec.Decoder cellDecoder, int expectedCount) throws IOException
cellDecoder
- Cell decoder.expectedCount
- Expected cell count.IOException
public long estimatedSerializedSizeOf()
public static WALEdit createFlushWALEdit(RegionInfo hri, org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.FlushDescriptor f)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.FlushDescriptor getFlushDescriptor(Cell cell) throws IOException
IOException
public static WALEdit createRegionEventWALEdit(RegionInfo hri, org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.RegionEventDescriptor regionEventDesc)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.RegionEventDescriptor getRegionEventDescriptor(Cell cell) throws IOException
IOException
public static WALEdit createCompaction(RegionInfo hri, org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.CompactionDescriptor c)
c
- c
serialized as its valuepublic static byte[] getRowForRegion(RegionInfo hri)
public static org.apache.hadoop.hbase.shaded.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(RegionInfo hri, org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.BulkLoadDescriptor bulkLoadDescriptor)
hri
- The RegionInfo for the region in which we are bulk loadingbulkLoadDescriptor
- The descriptor for the Bulk Loaderpublic static org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.BulkLoadDescriptor getBulkLoadDescriptor(Cell cell) throws IOException
cell
- the key valueIOException
public void add(Map<byte[],List<Cell>> familyMap)
familyMap
- map of family->editsCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.