org.apache.hadoop.hbase.codec.prefixtree.encode.row
Class RowNodeWriter

java.lang.Object
  extended by org.apache.hadoop.hbase.codec.prefixtree.encode.row.RowNodeWriter

@InterfaceAudience.Private
public class RowNodeWriter
extends Object

Serializes the fields comprising one node of the row trie, which can be a branch, nub, or leaf. Please see the write() method for the order in which data is written.


Field Summary
protected  PrefixTreeBlockMeta blockMeta
           
protected  int fanOut
           
protected static org.apache.commons.logging.Log LOG
           
protected  int numCells
           
protected  PrefixTreeEncoder prefixTreeEncoder
          fields
protected  TokenizerNode tokenizerNode
           
protected  int tokenWidth
           
protected  int width
           
 
Constructor Summary
RowNodeWriter(PrefixTreeEncoder keyValueBuilder, TokenizerNode tokenizerNode)
          construct
 
Method Summary
protected  void calculateOffsetsAndLengths()
          methods
 int calculateWidth()
           
 int calculateWidthOverrideOffsetWidth(int offsetWidth)
           
 void reconstruct(PrefixTreeEncoder prefixTreeEncoder, TokenizerNode tokenizerNode)
           
 void reset(TokenizerNode node)
           
 void write(OutputStream os)
          writing the compiled structure to the OutputStream
protected  void writeCellTypes(OutputStream os)
           
protected  void writeFamilyNodeOffsets(OutputStream os)
          The following methods write data for each cell in the row, mostly consisting of indexes or offsets into the timestamp/column data structures that are written in the middle of the block.
 void writeFan(OutputStream os)
          UVInt: numFanBytes/fanOut bytes: each fan byte
protected  void writeMvccVersionIndexes(OutputStream os)
           
protected  void writeNextRowTrieNodeOffsets(OutputStream os)
          If a branch or a nub, the last thing we append are the UFInt offsets to the child row nodes.
protected  void writeNumCells(OutputStream os)
          UVInt: numCells, the number of cells in this row which will be 0 for branch nodes
protected  void writeQualifierNodeOffsets(OutputStream os)
           
protected  void writeRowToken(OutputStream os)
          UVInt: tokenWidth bytes: token
protected  void writeTimestampIndexes(OutputStream os)
           
protected  void writeValueLengths(OutputStream os)
           
protected  void writeValueOffsets(OutputStream os)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG

prefixTreeEncoder

protected PrefixTreeEncoder prefixTreeEncoder
fields


blockMeta

protected PrefixTreeBlockMeta blockMeta

tokenizerNode

protected TokenizerNode tokenizerNode

tokenWidth

protected int tokenWidth

fanOut

protected int fanOut

numCells

protected int numCells

width

protected int width
Constructor Detail

RowNodeWriter

public RowNodeWriter(PrefixTreeEncoder keyValueBuilder,
                     TokenizerNode tokenizerNode)
construct

Method Detail

reconstruct

public void reconstruct(PrefixTreeEncoder prefixTreeEncoder,
                        TokenizerNode tokenizerNode)

reset

public void reset(TokenizerNode node)

calculateOffsetsAndLengths

protected void calculateOffsetsAndLengths()
methods


calculateWidth

public int calculateWidth()

calculateWidthOverrideOffsetWidth

public int calculateWidthOverrideOffsetWidth(int offsetWidth)

write

public void write(OutputStream os)
           throws IOException
writing the compiled structure to the OutputStream

Throws:
IOException

writeRowToken

protected void writeRowToken(OutputStream os)
                      throws IOException
UVInt: tokenWidth bytes: token

Throws:
IOException

writeFan

public void writeFan(OutputStream os)
              throws IOException
UVInt: numFanBytes/fanOut bytes: each fan byte

Throws:
IOException

writeNumCells

protected void writeNumCells(OutputStream os)
                      throws IOException
UVInt: numCells, the number of cells in this row which will be 0 for branch nodes

Throws:
IOException

writeFamilyNodeOffsets

protected void writeFamilyNodeOffsets(OutputStream os)
                               throws IOException
The following methods write data for each cell in the row, mostly consisting of indexes or offsets into the timestamp/column data structures that are written in the middle of the block. We use UFIntTool to encode these indexes/offsets to allow random access during a binary search of a particular column/timestamp combination.

Branch nodes will not have any data in these sections.

Throws:
IOException

writeQualifierNodeOffsets

protected void writeQualifierNodeOffsets(OutputStream os)
                                  throws IOException
Throws:
IOException

writeTimestampIndexes

protected void writeTimestampIndexes(OutputStream os)
                              throws IOException
Throws:
IOException

writeMvccVersionIndexes

protected void writeMvccVersionIndexes(OutputStream os)
                                throws IOException
Throws:
IOException

writeCellTypes

protected void writeCellTypes(OutputStream os)
                       throws IOException
Throws:
IOException

writeValueOffsets

protected void writeValueOffsets(OutputStream os)
                          throws IOException
Throws:
IOException

writeValueLengths

protected void writeValueLengths(OutputStream os)
                          throws IOException
Throws:
IOException

writeNextRowTrieNodeOffsets

protected void writeNextRowTrieNodeOffsets(OutputStream os)
                                    throws IOException
If a branch or a nub, the last thing we append are the UFInt offsets to the child row nodes.

Throws:
IOException


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