@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.
| 限定符和类型 | 字段和说明 |
|---|---|
static byte[] |
BULK_LOAD |
static byte[] |
COMPACTION |
static byte[] |
FLUSH |
static byte[] |
METAFAMILY |
static byte[] |
METAROW |
static byte[] |
REGION_EVENT |
| 构造器和说明 |
|---|
WALEdit() |
WALEdit(boolean isReplay)
已过时。
Since 2.0.1. Use
WALEdit(int, boolean) instead. |
WALEdit(int cellCount)
已过时。
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 METAFAMILYpublic 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.IOExceptionpublic 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
IOExceptionpublic 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
IOExceptionpublic 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 valueIOExceptionpublic static boolean isCompactionMarker(Cell cell)
WALProtos.CompactionDescriptorgetCompaction(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 valueIOExceptionpublic void add(Map<byte[],List<Cell>> familyMap)
familyMap - map of family->editsCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.