org.apache.hadoop.hbase.codec.prefixtree.encode.column
Class ColumnNodeWriter

java.lang.Object
  extended by org.apache.hadoop.hbase.codec.prefixtree.encode.column.ColumnNodeWriter

@InterfaceAudience.Private
public class ColumnNodeWriter
extends Object

Column nodes can be either family nodes or qualifier nodes, as both sections encode similarly. The family and qualifier sections of the data block are made of 1 or more of these nodes.

Each node is composed of 3 sections:

  • tokenLength: UVInt (normally 1 byte) indicating the number of token bytes
  • token[]: the actual token bytes
  • parentStartPosition: the offset of the next node from the start of the family or qualifier section


    Field Summary
    protected  PrefixTreeBlockMeta blockMeta
               
    protected  TokenizerNode builderNode
              fields
    protected  ColumnNodeType nodeType
               
    protected  int parentStartPosition
               
    protected  byte[] token
               
    protected  int tokenLength
               
     
    Constructor Summary
    ColumnNodeWriter(PrefixTreeBlockMeta blockMeta, TokenizerNode builderNode, ColumnNodeType nodeType)
              construct
     
    Method Summary
     int getWidthUsingPlaceholderForOffsetWidth(int offsetWidthPlaceholder)
              This method is called before blockMeta.qualifierOffsetWidth is known, so we pass in a placeholder.
     boolean isRoot()
              methods
     void setParentStartPosition(int parentStartPosition)
              get/set
     void setTokenBytes(ByteRange source)
               
     String toString()
              standard methods
     void writeBytes(OutputStream os)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Field Detail

    builderNode

    protected TokenizerNode builderNode
    fields


    blockMeta

    protected PrefixTreeBlockMeta blockMeta

    tokenLength

    protected int tokenLength

    token

    protected byte[] token

    parentStartPosition

    protected int parentStartPosition

    nodeType

    protected ColumnNodeType nodeType
    Constructor Detail

    ColumnNodeWriter

    public ColumnNodeWriter(PrefixTreeBlockMeta blockMeta,
                            TokenizerNode builderNode,
                            ColumnNodeType nodeType)
    construct

    Method Detail

    isRoot

    public boolean isRoot()
    methods


    getWidthUsingPlaceholderForOffsetWidth

    public int getWidthUsingPlaceholderForOffsetWidth(int offsetWidthPlaceholder)
    This method is called before blockMeta.qualifierOffsetWidth is known, so we pass in a placeholder.

    Parameters:
    offsetWidthPlaceholder - the placeholder
    Returns:
    node width

    writeBytes

    public void writeBytes(OutputStream os)
                    throws IOException
    Throws:
    IOException

    setTokenBytes

    public void setTokenBytes(ByteRange source)

    toString

    public String toString()
    standard methods

    Overrides:
    toString in class Object

    setParentStartPosition

    public void setParentStartPosition(int parentStartPosition)
    get/set



    Copyright © 2015 The Apache Software Foundation. All rights reserved.