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

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

@InterfaceAudience.Private
public class PrefixTreeArrayScanner
extends PrefixTreeCell
implements CellScanner

Extends PtCell and manipulates its protected fields. Could alternatively contain a PtCell and call get/set methods. This is an "Array" scanner to distinguish from a future "ByteBuffer" scanner. This implementation requires that the bytes be in a normal java byte[] for performance. The alternative ByteBuffer implementation would allow for accessing data in an off-heap ByteBuffer without copying the whole buffer on-heap.


Field Summary
protected  boolean afterLast
           
protected  boolean beforeFirst
           
protected  PrefixTreeBlockMeta blockMeta
          fields
protected  int currentCellIndex
           
protected  RowNodeReader currentRowNode
           
protected  ColumnReader familyReader
           
protected  MvccVersionDecoder mvccVersionDecoder
           
protected  boolean nubCellsRemain
           
protected  ColumnReader qualifierReader
           
protected  RowNodeReader[] rowNodes
           
protected  int rowNodeStackIndex
           
protected  ColumnReader tagsReader
           
protected  TimestampDecoder timestampDecoder
           
 
Fields inherited from class org.apache.hadoop.hbase.codec.prefixtree.decode.PrefixTreeCell
absoluteValueOffset, block, DEFAULT_TYPE, familyBuffer, familyLength, familyOffset, includeMvccVersion, mvccVersion, qualifierBuffer, qualifierLength, qualifierOffset, rowBuffer, rowLength, tagsBuffer, tagsLength, tagsOffset, timestamp, type, TYPES, valueLength
 
Constructor Summary
PrefixTreeArrayScanner(PrefixTreeBlockMeta blockMeta, int rowTreeDepth, int rowBufferLength, int qualifierBufferLength, int tagsBufferLength)
          construct
 
Method Summary
 boolean advance()
           
protected  void appendCurrentTokenToRowBuffer()
          helper methods
protected  void appendToRowBuffer(byte b)
           
 boolean areBuffersBigEnough()
          Call when first accessing a block.
 Cell current()
          CellScanner
protected  void discardCurrentRowNode(boolean forwards)
           
 boolean equals(Object obj)
          Object methods
protected  void followCurrentFan()
           
protected  void followFan(int fanIndex)
           
protected  void followFirstFan()
           
protected  void followLastFan()
           
protected  void followNextFan()
           
protected  void followPreviousFan()
           
 PrefixTreeBlockMeta getBlockMeta()
           
 int getMaxRowTreeStackNodes()
           
 int getQualifierBufferLength()
           
 int getRowBufferLength()
           
 int getTagBufferLength()
           
 byte[] getTreeBytes()
          getters
 int hashCode()
           
protected  boolean hasOccurrences()
           
protected  void initFirstNode()
           
 void initOnBlock(PrefixTreeBlockMeta blockMeta, byte[] block, boolean includeMvccVersion)
           
 boolean isAfterLast()
           
 boolean isBeforeFirst()
           
protected  boolean isBranch()
           
protected  boolean isFirstCellInRow()
           
protected  boolean isLastCellInRow()
           
protected  boolean isLeaf()
           
protected  boolean isNub()
           
protected  boolean isOutOfBounds()
           
protected  void markAfterLast()
           
protected  void markBeforeFirst()
           
 boolean nextRow()
           
protected  boolean nextRowInternal()
          This method is safe to call when the scanner is not on a fully valid row node, as in the case of a row token miss in the Searcher
protected  void popFromRowBuffer(RowNodeReader rowNodeBeingPopped)
           
protected  void populateFamily()
           
protected  void populateFirstNonRowFields()
           
protected  void populateLastNonRowFields()
           
protected  void populateMvccVersion()
           
protected  void populateNonRowFields(int cellIndex)
           
protected  int populateNonRowFieldsAndCompareTo(int cellNum, Cell key)
          fill in family/qualifier/ts/type/value
protected  void populatePreviousNonRowFields()
           
protected  void populateQualifier()
           
protected  void populateTag()
           
protected  void populateTimestamp()
           
protected  void populateType()
           
protected  void populateValueOffsets()
           
 boolean positionAtFirstCell()
          advance
protected  void reInitFirstNode()
          secondary traversal methods
 void releaseBlockReference()
          Call this before putting the scanner back into a pool so it doesn't hold the last used block in memory.
 void resetToBeforeFirstEntry()
           
 String toString()
          Override PrefixTreeCell.toString() with a check to see if the current cell is valid.
 
Methods inherited from class org.apache.hadoop.hbase.codec.prefixtree.decode.PrefixTreeCell
compareTo, getFamily, getFamilyArray, getFamilyLength, getFamilyOffset, getKeyValueString, getMvccVersion, getQualifier, getQualifierArray, getQualifierLength, getQualifierOffset, getRow, getRowArray, getRowLength, getRowOffset, getTagsArray, getTagsLength, getTagsLengthUnsigned, getTagsOffset, getTimestamp, getTypeByte, getValue, getValueArray, getValueLength, getValueOffset
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

blockMeta

protected PrefixTreeBlockMeta blockMeta
fields


beforeFirst

protected boolean beforeFirst

afterLast

protected boolean afterLast

rowNodes

protected RowNodeReader[] rowNodes

rowNodeStackIndex

protected int rowNodeStackIndex

currentRowNode

protected RowNodeReader currentRowNode

familyReader

protected ColumnReader familyReader

qualifierReader

protected ColumnReader qualifierReader

tagsReader

protected ColumnReader tagsReader

timestampDecoder

protected TimestampDecoder timestampDecoder

mvccVersionDecoder

protected MvccVersionDecoder mvccVersionDecoder

nubCellsRemain

protected boolean nubCellsRemain

currentCellIndex

protected int currentCellIndex
Constructor Detail

PrefixTreeArrayScanner

public PrefixTreeArrayScanner(PrefixTreeBlockMeta blockMeta,
                              int rowTreeDepth,
                              int rowBufferLength,
                              int qualifierBufferLength,
                              int tagsBufferLength)
construct

Method Detail

areBuffersBigEnough

public boolean areBuffersBigEnough()
Call when first accessing a block.

Returns:
entirely new scanner if false

initOnBlock

public void initOnBlock(PrefixTreeBlockMeta blockMeta,
                        byte[] block,
                        boolean includeMvccVersion)

resetToBeforeFirstEntry

public void resetToBeforeFirstEntry()

releaseBlockReference

public void releaseBlockReference()
Call this before putting the scanner back into a pool so it doesn't hold the last used block in memory.


current

public Cell current()
CellScanner

Specified by:
current in interface CellScanner

equals

public boolean equals(Object obj)
Object methods

Overrides:
equals in class PrefixTreeCell

hashCode

public int hashCode()
Overrides:
hashCode in class PrefixTreeCell

toString

public String toString()
Override PrefixTreeCell.toString() with a check to see if the current cell is valid.

Overrides:
toString in class PrefixTreeCell

positionAtFirstCell

public boolean positionAtFirstCell()
advance


advance

public boolean advance()
Specified by:
advance in interface CellScanner

nextRow

public boolean nextRow()

nextRowInternal

protected boolean nextRowInternal()
This method is safe to call when the scanner is not on a fully valid row node, as in the case of a row token miss in the Searcher

Returns:
true if we are positioned on a valid row, false if past end of block

reInitFirstNode

protected void reInitFirstNode()
secondary traversal methods


initFirstNode

protected void initFirstNode()

followFirstFan

protected void followFirstFan()

followPreviousFan

protected void followPreviousFan()

followCurrentFan

protected void followCurrentFan()

followNextFan

protected void followNextFan()

followLastFan

protected void followLastFan()

followFan

protected void followFan(int fanIndex)

discardCurrentRowNode

protected void discardCurrentRowNode(boolean forwards)
Parameters:
forwards - which marker to set if we overflow

markBeforeFirst

protected void markBeforeFirst()

markAfterLast

protected void markAfterLast()

appendCurrentTokenToRowBuffer

protected void appendCurrentTokenToRowBuffer()
helper methods


appendToRowBuffer

protected void appendToRowBuffer(byte b)

popFromRowBuffer

protected void popFromRowBuffer(RowNodeReader rowNodeBeingPopped)

hasOccurrences

protected boolean hasOccurrences()

isBranch

protected boolean isBranch()

isNub

protected boolean isNub()

isLeaf

protected boolean isLeaf()

isBeforeFirst

public boolean isBeforeFirst()

isAfterLast

public boolean isAfterLast()

isOutOfBounds

protected boolean isOutOfBounds()

isFirstCellInRow

protected boolean isFirstCellInRow()

isLastCellInRow

protected boolean isLastCellInRow()

populateNonRowFieldsAndCompareTo

protected int populateNonRowFieldsAndCompareTo(int cellNum,
                                               Cell key)
fill in family/qualifier/ts/type/value


populateFirstNonRowFields

protected void populateFirstNonRowFields()

populatePreviousNonRowFields

protected void populatePreviousNonRowFields()

populateLastNonRowFields

protected void populateLastNonRowFields()

populateNonRowFields

protected void populateNonRowFields(int cellIndex)

populateFamily

protected void populateFamily()

populateQualifier

protected void populateQualifier()

populateTag

protected void populateTag()

populateTimestamp

protected void populateTimestamp()

populateMvccVersion

protected void populateMvccVersion()

populateType

protected void populateType()

populateValueOffsets

protected void populateValueOffsets()

getTreeBytes

public byte[] getTreeBytes()
getters


getBlockMeta

public PrefixTreeBlockMeta getBlockMeta()

getMaxRowTreeStackNodes

public int getMaxRowTreeStackNodes()

getRowBufferLength

public int getRowBufferLength()

getQualifierBufferLength

public int getQualifierBufferLength()

getTagBufferLength

public int getTagBufferLength()


Copyright © 2015 The Apache Software Foundation. All Rights Reserved.