org.apache.hadoop.hbase.codec.prefixtree.encode.other
Class CellTypeEncoder

java.lang.Object
  extended by org.apache.hadoop.hbase.codec.prefixtree.encode.other.CellTypeEncoder

@InterfaceAudience.Private
public class CellTypeEncoder
extends Object

Detect if every KV has the same KeyValue.Type, in which case we don't need to store it for each KV. If(allSameType) during conversion to byte[], then we can store the "onlyType" in blockMeta, therefore not repeating it for each cell and saving 1 byte per cell.


Field Summary
protected  boolean allSameType
           
protected  byte onlyType
           
protected  boolean pendingFirstType
          fields
 
Constructor Summary
CellTypeEncoder()
           
 
Method Summary
 void add(byte type)
          methods
 boolean areAllSameType()
          get/set
 byte getOnlyType()
           
 void reset()
          construct
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pendingFirstType

protected boolean pendingFirstType
fields


allSameType

protected boolean allSameType

onlyType

protected byte onlyType
Constructor Detail

CellTypeEncoder

public CellTypeEncoder()
Method Detail

reset

public void reset()
construct


add

public void add(byte type)
methods


areAllSameType

public boolean areAllSameType()
get/set


getOnlyType

public byte getOnlyType()


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