@InterfaceAudience.Private public class ByteBufferKeyOnlyKeyValue extends ByteBufferExtendedCell
KeyValue.KeyOnlyKeyValue
 with respect to key serialization but have its data in the form of Byte buffer
 (onheap and offheap).| Modifier and Type | Field and Description | 
|---|---|
| private ByteBuffer | buf | 
| static int | FIXED_OVERHEAD | 
| private int | length | 
| private int | offset | 
| private short | rowLen | 
CELL_NOT_BASED_ON_CHUNKMAX_TAGS_LENGTH| Constructor and Description | 
|---|
| ByteBufferKeyOnlyKeyValue()Used in cases where we want to avoid lot of garbage by allocating new objects with different
 keys. | 
| ByteBufferKeyOnlyKeyValue(ByteBuffer buf,
                         int offset,
                         int length) | 
| Modifier and Type | Method and Description | 
|---|---|
| byte[] | getFamilyArray()Contiguous bytes composed of legal HDFS filename characters which may start at any index in the
 containing array. | 
| ByteBuffer | getFamilyByteBuffer() | 
| byte | getFamilyLength() | 
| private byte | getFamilyLength(int famLenPos) | 
| private int | getFamilyLengthPosition() | 
| int | getFamilyOffset() | 
| int | getFamilyPosition() | 
| byte[] | getQualifierArray()Contiguous raw bytes that may start at any index in the containing array. | 
| ByteBuffer | getQualifierByteBuffer() | 
| int | getQualifierLength() | 
| private int | getQualifierLength(int rlength,
                  int flength) | 
| int | getQualifierOffset() | 
| int | getQualifierPosition() | 
| byte[] | getRowArray()Contiguous raw bytes that may start at any index in the containing array. | 
| ByteBuffer | getRowByteBuffer() | 
| short | getRowLength() | 
| int | getRowOffset() | 
| int | getRowPosition() | 
| long | getSequenceId()A region-specific unique monotonically increasing sequence ID given to each Cell. | 
| Optional<Tag> | getTag(byte type)Returns the specific tag of the given type | 
| Iterator<Tag> | getTags()Creates a list of tags in the current cell | 
| byte[] | getTagsArray()Contiguous raw bytes representing tags that may start at any index in the containing array. | 
| ByteBuffer | getTagsByteBuffer() | 
| int | getTagsLength()HBase internally uses 2 bytes to store tags length in Cell. | 
| int | getTagsOffset() | 
| int | getTagsPosition() | 
| long | getTimestamp() | 
| private int | getTimestampOffset() | 
| byte | getTypeByte() | 
| byte[] | getValueArray()Contiguous raw bytes that may start at any index in the containing array. | 
| ByteBuffer | getValueByteBuffer() | 
| int | getValueLength() | 
| int | getValueOffset() | 
| int | getValuePosition() | 
| long | heapSize() | 
| void | setKey(ByteBuffer key,
      int offset,
      int length)A setter that helps to avoid object creation every time and whenever
 there is a need to create new OffheapKeyOnlyKeyValue. | 
| void | setKey(ByteBuffer key,
      int offset,
      int length,
      short rowLen)A setter that helps to avoid object creation every time and whenever
 there is a need to create new OffheapKeyOnlyKeyValue. | 
| 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() | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdeepClone, getChunkId, getSerializedSize, getSerializedSize, write, writecheckForTagsLength, cloneTagspublic static final int FIXED_OVERHEAD
private ByteBuffer buf
private int offset
private int length
private short rowLen
public ByteBufferKeyOnlyKeyValue()
setKey(ByteBuffer, int, int)public ByteBufferKeyOnlyKeyValue(ByteBuffer buf, int offset, int length)
public void setKey(ByteBuffer key, int offset, int length)
key - offset - length - public void setKey(ByteBuffer key, int offset, int length, short rowLen)
key - - the key part of the celloffset - - offset of the celllength - - length of the cellrowLen - - the rowlen part of the cellpublic byte[] getRowArray()
Cellpublic int getRowOffset()
public short getRowLength()
public byte[] getFamilyArray()
Cellpublic int getFamilyOffset()
public byte getFamilyLength()
private byte getFamilyLength(int famLenPos)
public byte[] getQualifierArray()
Cellpublic int getQualifierOffset()
public int getQualifierLength()
private int getQualifierLength(int rlength, int flength)
public long getTimestamp()
private int getTimestampOffset()
public byte getTypeByte()
public void setSequenceId(long seqId) throws IOException
ExtendedCellseqId - sequence IDIOExceptionpublic void setTimestamp(long ts) throws IOException
ExtendedCellts - timestampIOExceptionpublic void setTimestamp(byte[] ts) throws IOException
ExtendedCellts - buffer containing the timestamp valueIOExceptionpublic long getSequenceId()
ExtendedCellHConstants.KEEP_SEQID_PERIOD days, but generally becomes irrelevant after the cell's
 row is no longer involved in any operations that require strict consistency.public byte[] getValueArray()
Cellpublic int getValueOffset()
public int getValueLength()
public byte[] getTagsArray()
ExtendedCellpublic int getTagsOffset()
public int getTagsLength()
ExtendedCellpublic ByteBuffer getRowByteBuffer()
getRowByteBuffer in class ByteBufferExtendedCellByteBuffer containing the row bytes.public int getRowPosition()
getRowPosition in class ByteBufferExtendedCellByteBuffer where row bytes startpublic ByteBuffer getFamilyByteBuffer()
getFamilyByteBuffer in class ByteBufferExtendedCellByteBuffer containing the column family bytes.public int getFamilyPosition()
getFamilyPosition in class ByteBufferExtendedCellByteBuffer where column family bytes startprivate int getFamilyLengthPosition()
public ByteBuffer getQualifierByteBuffer()
getQualifierByteBuffer in class ByteBufferExtendedCellByteBuffer containing the column qualifier bytes.public int getQualifierPosition()
getQualifierPosition in class ByteBufferExtendedCellByteBuffer where column qualifier bytes startpublic ByteBuffer getValueByteBuffer()
getValueByteBuffer in class ByteBufferExtendedCellByteBuffer containing the value bytes.public int getValuePosition()
getValuePosition in class ByteBufferExtendedCellByteBuffer where value bytes startpublic ByteBuffer getTagsByteBuffer()
getTagsByteBuffer in class ByteBufferExtendedCellByteBuffer containing the tag bytes.public int getTagsPosition()
getTagsPosition in class ByteBufferExtendedCellByteBuffer where tag bytes startpublic Iterator<Tag> getTags()
RawCellpublic Optional<Tag> getTag(byte type)
RawCelltype - the type of the tagpublic long heapSize()
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.