org.apache.hadoop.hbase.codec.prefixtree.decode
Class PrefixTreeCell

java.lang.Object
  extended by org.apache.hadoop.hbase.codec.prefixtree.decode.PrefixTreeCell
All Implemented Interfaces:
Comparable<Cell>, Cell
Direct Known Subclasses:
PrefixTreeArrayScanner

@InterfaceAudience.Private
public class PrefixTreeCell
extends Object
implements Cell, Comparable<Cell>

As the PrefixTreeArrayScanner moves through the tree bytes, it changes the values in the fields of this class so that Cell logic can be applied, but without allocating new memory for every Cell iterated through.


Field Summary
protected  int absoluteValueOffset
           
protected  byte[] block
          fields
static KeyValue.Type DEFAULT_TYPE
           
protected  byte[] familyBuffer
           
protected  int familyLength
           
protected  int familyOffset
           
protected  boolean includeMvccVersion
           
protected  Long mvccVersion
           
protected  byte[] qualifierBuffer
           
protected  int qualifierLength
           
protected  int qualifierOffset
           
protected  byte[] rowBuffer
           
protected  int rowLength
           
protected  byte[] tagsBuffer
           
protected  int tagsLength
           
protected  int tagsOffset
           
protected  Long timestamp
           
protected  KeyValue.Type type
           
static KeyValue.Type[] TYPES
          static
protected  int valueLength
           
 
Constructor Summary
PrefixTreeCell()
           
 
Method Summary
 int compareTo(Cell other)
           
 boolean equals(Object obj)
           
 byte[] getFamily()
          WARNING do not use, expensive.
 byte[] getFamilyArray()
          Contiguous bytes composed of legal HDFS filename characters which may start at any index in the containing array.
 byte getFamilyLength()
           
 int getFamilyOffset()
           
protected  String getKeyValueString()
          Need this separate method so we can call it from subclasses' toString() methods
 long getMvccVersion()
          Internal use only.
 byte[] getQualifier()
          WARNING do not use, expensive.
 byte[] getQualifierArray()
          Contiguous raw bytes that may start at any index in the containing array.
 int getQualifierLength()
           
 int getQualifierOffset()
           
 byte[] getRow()
          WARNING do not use, expensive.
 byte[] getRowArray()
          Contiguous raw bytes that may start at any index in the containing array.
 short getRowLength()
           
 int getRowOffset()
           
 byte[] getTagsArray()
           
 short getTagsLength()
          Deprecated. 
 int getTagsLengthUnsigned()
          Deprecated. 
 int getTagsOffset()
           
 long getTimestamp()
           
 byte getTypeByte()
           
 byte[] getValue()
          WARNING do not use, expensive.
 byte[] getValueArray()
          Contiguous raw bytes that may start at any index in the containing array.
 int getValueLength()
           
 int getValueOffset()
           
 int hashCode()
           
 String toString()
          For debugging.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPES

public static final KeyValue.Type[] TYPES
static


DEFAULT_TYPE

public static final KeyValue.Type DEFAULT_TYPE

block

protected byte[] block
fields


includeMvccVersion

protected boolean includeMvccVersion

rowBuffer

protected byte[] rowBuffer

rowLength

protected int rowLength

familyBuffer

protected byte[] familyBuffer

familyOffset

protected int familyOffset

familyLength

protected int familyLength

qualifierBuffer

protected byte[] qualifierBuffer

qualifierOffset

protected int qualifierOffset

qualifierLength

protected int qualifierLength

timestamp

protected Long timestamp

mvccVersion

protected Long mvccVersion

type

protected KeyValue.Type type

absoluteValueOffset

protected int absoluteValueOffset

valueLength

protected int valueLength

tagsBuffer

protected byte[] tagsBuffer

tagsOffset

protected int tagsOffset

tagsLength

protected int tagsLength
Constructor Detail

PrefixTreeCell

public PrefixTreeCell()
Method Detail

toString

public String toString()
For debugging. Currently creates new KeyValue to utilize its toString() method.

Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(Cell other)
Specified by:
compareTo in interface Comparable<Cell>

getTimestamp

public long getTimestamp()
Specified by:
getTimestamp in interface Cell
Returns:
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.

getMvccVersion

public long getMvccVersion()
Description copied from interface: Cell
Internal use only. A region-specific sequence ID given to each operation. It always exists for cells in the memstore but is not retained forever. It may survive several flushes, but generally becomes irrelevant after the cell's row is no longer involved in any operations that require strict consistency.

Specified by:
getMvccVersion in interface Cell
Returns:
mvccVersion (always >= 0 if exists), or 0 if it no longer exists

getValueLength

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

getRowArray

public byte[] getRowArray()
Description copied from interface: Cell
Contiguous raw bytes that may start at any index in the containing array. Max length is Short.MAX_VALUE which is 32,767 bytes.

Specified by:
getRowArray in interface Cell
Returns:
The array containing the row bytes.

getRowOffset

public int getRowOffset()
Specified by:
getRowOffset in interface Cell
Returns:
Array index of first row byte

getRowLength

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

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()
Specified by:
getFamilyOffset in interface Cell
Returns:
Array index of first family byte

getFamilyLength

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

getQualifierArray

public byte[] getQualifierArray()
Description copied from interface: Cell
Contiguous raw bytes that may start at any index in the containing array. Max length is Short.MAX_VALUE which is 32,767 bytes.

Specified by:
getQualifierArray in interface Cell
Returns:
The array containing the qualifier bytes.

getQualifierOffset

public int getQualifierOffset()
Specified by:
getQualifierOffset in interface Cell
Returns:
Array index of first qualifier byte

getQualifierLength

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

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,648 bytes.

Specified by:
getValueArray in interface Cell
Returns:
The array containing the value bytes.

getValueOffset

public int getValueOffset()
Specified by:
getValueOffset in interface Cell
Returns:
Array index of first value byte

getTypeByte

public byte getTypeByte()
Specified by:
getTypeByte in interface Cell
Returns:
The byte representation of the KeyValue.TYPE of this cell: one of Put, Delete, etc

getValue

public byte[] getValue()
Description copied from interface: Cell
WARNING do not use, expensive. This gets an arraycopy of the cell's value. Added to ease transition from 0.94 -> 0.96.

Specified by:
getValue in interface Cell

getFamily

public byte[] getFamily()
Description copied from interface: Cell
WARNING do not use, expensive. This gets an arraycopy of the cell's family. Added to ease transition from 0.94 -> 0.96.

Specified by:
getFamily in interface Cell

getQualifier

public byte[] getQualifier()
Description copied from interface: Cell
WARNING do not use, expensive. This gets an arraycopy of the cell's qualifier. Added to ease transition from 0.94 -> 0.96.

Specified by:
getQualifier in interface Cell

getRow

public byte[] getRow()
Description copied from interface: Cell
WARNING do not use, expensive. this gets an arraycopy of the cell's row. Added to ease transition from 0.94 -> 0.96.

Specified by:
getRow in interface Cell

getKeyValueString

protected String getKeyValueString()
Need this separate method so we can call it from subclasses' toString() methods


getTagsOffset

public int getTagsOffset()
Specified by:
getTagsOffset in interface Cell
Returns:
the first offset where the tags start in the Cell

getTagsLengthUnsigned

@Deprecated
public int getTagsLengthUnsigned()
Deprecated. 

Specified by:
getTagsLengthUnsigned in interface Cell
Returns:
the total length of the tags in the Cell.

getTagsLength

@Deprecated
public short getTagsLength()
Deprecated. 

Specified by:
getTagsLength in interface Cell
Returns:
the total length of the tags in the Cell.

getTagsArray

public byte[] getTagsArray()
Specified by:
getTagsArray in interface Cell
Returns:
the tags byte array


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.