protected static class BufferedDataBlockEncoder.OnheapDecodedCell extends Object implements ExtendedCell
Modifier and Type | Field and Description |
---|---|
private byte |
familyLength |
private int |
familyOffset |
private static long |
FIXED_OVERHEAD |
private byte[] |
keyOnlyBuffer |
private int |
qualifierLength |
private int |
qualifierOffset |
private short |
rowLength |
private long |
seqId |
private byte[] |
tagsBuffer |
private int |
tagsLength |
private int |
tagsOffset |
private long |
timeStamp |
private byte |
typeByte |
private byte[] |
valueBuffer |
private int |
valueLength |
private int |
valueOffset |
CELL_NOT_BASED_ON_CHUNK
MAX_TAGS_LENGTH
Modifier | Constructor and Description |
---|---|
protected |
OnheapDecodedCell(byte[] keyBuffer,
short rowLength,
int familyOffset,
byte familyLength,
int qualOffset,
int qualLength,
long timeStamp,
byte typeByte,
byte[] valueBuffer,
int valueOffset,
int valueLen,
long seqId,
byte[] tagsBuffer,
int tagsOffset,
int tagsLength) |
Modifier and Type | Method and Description |
---|---|
ExtendedCell |
deepClone()
Does a deep copy of the contents to a new memory area and returns it as a new cell.
|
byte[] |
getFamilyArray()
Contiguous bytes composed of legal HDFS filename characters which may start at any index in the
containing array.
|
byte |
getFamilyLength()
Returns Number of family bytes.
|
int |
getFamilyOffset()
Returns Array index of first family byte
|
byte[] |
getQualifierArray()
Contiguous raw bytes that may start at any index in the containing array.
|
int |
getQualifierLength()
Returns Number of qualifier bytes.
|
int |
getQualifierOffset()
Returns Array index of first qualifier byte
|
byte[] |
getRowArray()
Contiguous raw bytes that may start at any index in the containing array.
|
short |
getRowLength()
Returns Number of row bytes.
|
int |
getRowOffset()
Returns Array index of first row byte
|
long |
getSequenceId()
A region-specific unique monotonically increasing sequence ID given to each Cell.
|
int |
getSerializedSize(boolean withTags)
KeyValue format
<4 bytes keylength> <4 bytes valuelength> <2 bytes rowlength>
<row> <1 byte columnfamilylength> <columnfamily> <columnqualifier>
<8 bytes timestamp> <1 byte keytype> <value> <2 bytes tagslength>
<tags> |
byte[] |
getTagsArray()
Contiguous raw bytes representing tags that may start at any index in the containing array.
|
int |
getTagsLength()
HBase internally uses 2 bytes to store tags length in Cell.
|
int |
getTagsOffset()
Returns the first offset where the tags start in the Cell
|
long |
getTimestamp()
Return a long value representing time at which this cell was "Put" into the row.
|
byte |
getTypeByte()
Returns The byte representation of the KeyValue.TYPE of this cell: one of Put, Delete, etc
|
byte[] |
getValueArray()
Contiguous raw bytes that may start at any index in the containing array.
|
int |
getValueLength()
Returns Number of value bytes.
|
int |
getValueOffset()
Returns Array index of first value byte
|
long |
heapSize()
Return the approximate 'exclusive deep size' of implementing object.
|
void |
setSequenceId(long seqId)
Sets with the given seqId.
|
void |
setTimestamp(byte[] ts)
Sets with the given timestamp.
|
void |
setTimestamp(long ts)
Sets with the given timestamp.
|
String |
toString() |
void |
write(ByteBuffer buf,
int offset)
Write this Cell into the given buf's offset in a
KeyValue format. |
int |
write(OutputStream out,
boolean withTags)
Write this cell to an OutputStream in a
KeyValue format. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getChunkId, getSerializedSize
checkForTagsLength, cloneTags, createCell, getTag, getTags
private static final long FIXED_OVERHEAD
private byte[] keyOnlyBuffer
private short rowLength
private int familyOffset
private byte familyLength
private int qualifierOffset
private int qualifierLength
private long timeStamp
private byte typeByte
private byte[] valueBuffer
private int valueOffset
private int valueLength
private byte[] tagsBuffer
private int tagsOffset
private int tagsLength
private long seqId
protected OnheapDecodedCell(byte[] keyBuffer, short rowLength, int familyOffset, byte familyLength, int qualOffset, int qualLength, long timeStamp, byte typeByte, byte[] valueBuffer, int valueOffset, int valueLen, long seqId, byte[] tagsBuffer, int tagsOffset, int tagsLength)
public byte[] getRowArray()
Cell
getRowArray
in interface Cell
public byte[] getFamilyArray()
Cell
getFamilyArray
in interface Cell
public byte[] getQualifierArray()
Cell
getQualifierArray
in interface Cell
public int getRowOffset()
Cell
getRowOffset
in interface Cell
public short getRowLength()
Cell
getRowLength
in interface Cell
public int getFamilyOffset()
Cell
getFamilyOffset
in interface Cell
public byte getFamilyLength()
Cell
getFamilyLength
in interface Cell
public int getQualifierOffset()
Cell
getQualifierOffset
in interface Cell
public int getQualifierLength()
Cell
getQualifierLength
in interface Cell
public long getTimestamp()
Cell
getTimestamp
in interface Cell
public byte getTypeByte()
ExtendedCell
getTypeByte
in interface Cell
getTypeByte
in interface ExtendedCell
public long getSequenceId()
ExtendedCell
HConstants.KEEP_SEQID_PERIOD
days, but generally becomes irrelevant after the cell's
row is no longer involved in any operations that require strict consistency.getSequenceId
in interface Cell
getSequenceId
in interface ExtendedCell
public byte[] getValueArray()
Cell
getValueArray
in interface Cell
public int getValueOffset()
Cell
getValueOffset
in interface Cell
public int getValueLength()
Cell
getValueLength
in interface Cell
public byte[] getTagsArray()
ExtendedCell
getTagsArray
in interface Cell
getTagsArray
in interface ExtendedCell
public int getTagsOffset()
ExtendedCell
getTagsOffset
in interface Cell
getTagsOffset
in interface ExtendedCell
public int getTagsLength()
ExtendedCell
getTagsLength
in interface Cell
getTagsLength
in interface ExtendedCell
public void setSequenceId(long seqId)
ExtendedCell
setSequenceId
in interface ExtendedCell
seqId
- sequence IDpublic long heapSize()
HeapSize
public int write(OutputStream out, boolean withTags) throws IOException
ExtendedCell
KeyValue
format. <4 bytes keylength> <4 bytes valuelength> <2 bytes rowlength>
<row> <1 byte columnfamilylength> <columnfamily> <columnqualifier>
<8 bytes timestamp> <1 byte keytype> <value> <2 bytes tagslength>
<tags>
write
in interface ExtendedCell
out
- Stream to which cell has to be writtenwithTags
- Whether to write tags.IOException
public int getSerializedSize(boolean withTags)
ExtendedCell
<4 bytes keylength> <4 bytes valuelength> <2 bytes rowlength>
<row> <1 byte columnfamilylength> <columnfamily> <columnqualifier>
<8 bytes timestamp> <1 byte keytype> <value> <2 bytes tagslength>
<tags>
getSerializedSize
in interface ExtendedCell
withTags
- Whether to write tags.KeyValue
format.public void write(ByteBuffer buf, int offset)
ExtendedCell
KeyValue
format.write
in interface ExtendedCell
buf
- The buffer where to write the Cell.offset
- The offset within buffer, to write the Cell.public void setTimestamp(long ts) throws IOException
ExtendedCell
setTimestamp
in interface ExtendedCell
ts
- timestampIOException
public void setTimestamp(byte[] ts) throws IOException
ExtendedCell
setTimestamp
in interface ExtendedCell
ts
- buffer containing the timestamp valueIOException
public ExtendedCell deepClone()
ExtendedCell
deepClone
in interface ExtendedCell
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.