Class ByteBufferExtendedCell

java.lang.Object
org.apache.hadoop.hbase.ByteBufferExtendedCell
All Implemented Interfaces:
Cell, ExtendedCell, HeapSize, RawCell
Direct Known Subclasses:
BufferedDataBlockEncoder.OffheapDecodedExtendedCell, ByteBufferKeyOnlyKeyValue, ByteBufferKeyValue, KeyOnlyFilter.KeyOnlyByteBufferExtendedCell, MapReduceExtendedCell, PrivateCellUtil.EmptyByteBufferExtendedCell, PrivateCellUtil.TagRewriteByteBufferExtendedCell

@Private public abstract class ByteBufferExtendedCell extends Object implements ExtendedCell
This class is a server side extension to the Cell interface. It is used when the Cell is backed by a ByteBuffer: i.e. cell instanceof ByteBufferedCell.

This class has getters for the row, column family, column qualifier, value and tags hosting ByteBuffers. It also has getters of the *position* within a ByteBuffer where these field bytes begin. These are needed because a single ByteBuffer may back one or many Cell instances -- it depends on the implementation -- so the ByteBuffer position as returned by ByteBuffer.arrayOffset() cannot be relied upon. Also, do not confuse these position methods with the getXXXOffset methods from the super Interface, Cell; dependent up on implementation, the Cell getXXXOffset methods can return the same value as a call to its equivalent position method from below BUT they can also stray; if a ByteBufferedCell, use the below position methods to find where a field begins.

Use the getXXXLength methods from Cell to find a fields length.

A Cell object can be of this type only on the server side.

WARNING: If a Cell is backed by an offheap ByteBuffer, any call to getXXXArray() will result in a temporary byte array creation and a bytes copy. Avoid these allocations by using the appropriate Cell access server-side: i.e. ByteBufferedCell when backed by a ByteBuffer and Cell when it is not.