Class IndividualBytesFieldCell

java.lang.Object
org.apache.hadoop.hbase.IndividualBytesFieldCell
All Implemented Interfaces:
Cloneable, Cell, ExtendedCell, HeapSize, RawCell

@Private public class IndividualBytesFieldCell extends Object implements ExtendedCell, Cloneable
  • Field Details

    • FIXED_OVERHEAD

      private static final long FIXED_OVERHEAD
    • row

      private final byte[] row
    • rOffset

      private final int rOffset
    • rLength

      private final int rLength
    • family

      private final byte[] family
    • fOffset

      private final int fOffset
    • fLength

      private final int fLength
    • qualifier

      private final byte[] qualifier
    • qOffset

      private final int qOffset
    • qLength

      private final int qLength
    • value

      private final byte[] value
    • vOffset

      private final int vOffset
    • vLength

      private final int vLength
    • tags

      private final byte[] tags
    • tagsOffset

      private final int tagsOffset
    • tagsLength

      private final int tagsLength
    • timestamp

      private long timestamp
    • type

      private final byte type
    • seqId

      private long seqId
  • Constructor Details

    • IndividualBytesFieldCell

      public IndividualBytesFieldCell(byte[] row, byte[] family, byte[] qualifier, long timestamp, KeyValue.Type type, long seqId, byte[] value, byte[] tags)
    • IndividualBytesFieldCell

      public IndividualBytesFieldCell(byte[] row, int rOffset, int rLength, byte[] family, int fOffset, int fLength, byte[] qualifier, int qOffset, int qLength, long timestamp, KeyValue.Type type, long seqId, byte[] value, int vOffset, int vLength, byte[] tags, int tagsOffset, int tagsLength)
  • Method Details

    • checkArrayBounds

      private void checkArrayBounds(byte[] bytes, int offset, int length)
    • heapOverhead

      private long heapOverhead()
    • getRowArray

      public byte[] getRowArray()
      Implement Cell interface
      Specified by:
      getRowArray in interface Cell
      Returns:
      The array containing the row bytes.
    • getRowOffset

      public int getRowOffset()
      Description copied from interface: Cell
      Returns Array index of first row byte
      Specified by:
      getRowOffset in interface Cell
    • getRowLength

      public short getRowLength()
      Description copied from interface: Cell
      Returns Number of row bytes. Must be < rowArray.length - offset.
      Specified by:
      getRowLength in interface Cell
    • getFamilyArray

      public byte[] getFamilyArray()
      Description copied from interface: Cell
      Contiguous bytes composed of legal HDFS filename characters which may start at any index in the containing array. Max length is Byte.MAX_VALUE, which is 127 bytes.
      Specified by:
      getFamilyArray in interface Cell
      Returns:
      the array containing the family bytes.
    • getFamilyOffset

      public int getFamilyOffset()
      Description copied from interface: Cell
      Returns Array index of first family byte
      Specified by:
      getFamilyOffset in interface Cell
    • getFamilyLength

      public byte getFamilyLength()
      Description copied from interface: Cell
      Returns Number of family bytes. Must be < familyArray.length - offset.
      Specified by:
      getFamilyLength in interface Cell
    • getQualifierArray

      public byte[] getQualifierArray()
      Description copied from interface: Cell
      Contiguous raw bytes that may start at any index in the containing array.
      Specified by:
      getQualifierArray in interface Cell
      Returns:
      The array containing the qualifier bytes.
    • getQualifierOffset

      public int getQualifierOffset()
      Description copied from interface: Cell
      Returns Array index of first qualifier byte
      Specified by:
      getQualifierOffset in interface Cell
    • getQualifierLength

      public int getQualifierLength()
      Description copied from interface: Cell
      Returns Number of qualifier bytes. Must be < qualifierArray.length - offset.
      Specified by:
      getQualifierLength in interface Cell
    • getTimestamp

      public long getTimestamp()
      Description copied from interface: Cell
      Return a long value representing time at which this cell was "Put" into the row. Typically represents the time of insertion, but can be any value from 0 to Long.MAX_VALUE.
      Specified by:
      getTimestamp in interface Cell
    • getTypeByte

      public byte getTypeByte()
      Description copied from interface: ExtendedCell
      Returns The byte representation of the KeyValue.TYPE of this cell: one of Put, Delete, etc
      Specified by:
      getTypeByte in interface ExtendedCell
    • getSequenceId

      public long getSequenceId()
      Description copied from interface: ExtendedCell
      A region-specific unique monotonically increasing sequence ID given to each Cell. It always exists for cells in the memstore but is not retained forever. It will be kept for 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.
      Specified by:
      getSequenceId in interface ExtendedCell
      Returns:
      seqId (always > 0 if exists), or 0 if it no longer exists
    • getValueArray

      public byte[] getValueArray()
      Description copied from interface: Cell
      Contiguous raw bytes that may start at any index in the containing array. Max length is Integer.MAX_VALUE which is 2,147,483,647 bytes.
      Specified by:
      getValueArray in interface Cell
      Returns:
      The array containing the value bytes.
    • getValueOffset

      public int getValueOffset()
      Description copied from interface: Cell
      Returns Array index of first value byte
      Specified by:
      getValueOffset in interface Cell
    • getValueLength

      public int getValueLength()
      Description copied from interface: Cell
      Returns Number of value bytes. Must be < valueArray.length - offset.
      Specified by:
      getValueLength in interface Cell
    • getTagsArray

      public byte[] getTagsArray()
      Description copied from interface: RawCell
      Contiguous raw bytes representing tags that may start at any index in the containing array.
      Specified by:
      getTagsArray in interface RawCell
      Returns:
      the tags byte array
    • getTagsOffset

      public int getTagsOffset()
      Description copied from interface: RawCell
      Return the first offset where the tags start in the Cell
      Specified by:
      getTagsOffset in interface RawCell
    • getTagsLength

      public int getTagsLength()
      Description copied from interface: RawCell
      HBase internally uses 2 bytes to store tags length in Cell. As the tags length is always a non-negative number, to make good use of the sign bit, the max of tags length is defined 2 * Short.MAX_VALUE + 1 = 65535. As a result, the return type is int, because a short is not capable of handling that. Please note that even if the return type is int, the max tags length is far less than Integer.MAX_VALUE.
      Specified by:
      getTagsLength in interface RawCell
      Returns:
      the total length of the tags in the Cell.
    • heapSize

      public long heapSize()
      Implement HeapSize interface
      Specified by:
      heapSize in interface HeapSize
    • clone

      Implement Cloneable interface
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • setSequenceId

      public void setSequenceId(long seqId)
      Description copied from interface: ExtendedCell
      Sets with the given seqId.
      Specified by:
      setSequenceId in interface ExtendedCell
      Parameters:
      seqId - sequence ID
    • setTimestamp

      public void setTimestamp(long ts)
      Description copied from interface: ExtendedCell
      Sets with the given timestamp.
      Specified by:
      setTimestamp in interface ExtendedCell
      Parameters:
      ts - timestamp
    • setTimestamp

      public void setTimestamp(byte[] ts)
      Description copied from interface: ExtendedCell
      Sets with the given timestamp.
      Specified by:
      setTimestamp in interface ExtendedCell
      Parameters:
      ts - buffer containing the timestamp value
    • toString

      public String toString()
      Overrides:
      toString in class Object