org.apache.hadoop.hbase.codec.prefixtree
Class PrefixTreeCodec

java.lang.Object
  extended by org.apache.hadoop.hbase.codec.prefixtree.PrefixTreeCodec
All Implemented Interfaces:
DataBlockEncoder

@InterfaceAudience.Private
public class PrefixTreeCodec
extends Object
implements DataBlockEncoder

This class is created via reflection in DataBlockEncoding enum. Update the enum if class name or package changes.

PrefixTreeDataBlockEncoder implementation of DataBlockEncoder. This is the primary entry point for PrefixTree encoding and decoding. Encoding is delegated to instances of PrefixTreeEncoder, and decoding is delegated to instances of CellSearcher. Encoder and decoder instances are created and recycled by static PtEncoderFactory and PtDecoderFactory.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.io.encoding.DataBlockEncoder
DataBlockEncoder.EncodedSeeker
 
Constructor Summary
PrefixTreeCodec()
          no-arg constructor for reflection
 
Method Summary
 DataBlockEncoder.EncodedSeeker createSeeker(org.apache.hadoop.io.RawComparator<byte[]> comparator, boolean includesMvccVersion)
          Is this the correct handling of an illegal comparator? How to prevent that from getting all the way to this point.
 ByteBuffer decodeKeyValues(DataInputStream source, boolean includesMvccVersion)
           
 ByteBuffer decodeKeyValues(DataInputStream source, int allocateHeaderLength, int skipLastBytes, boolean includesMvccVersion)
          I don't think this method is called during normal HBase operation, so efficiency is not important.
 void encodeKeyValues(ByteBuffer in, boolean includesMvccVersion, HFileBlockEncodingContext blkEncodingCtx)
          Copied from BufferedDataBlockEncoder.
 ByteBuffer getFirstKeyInBlock(ByteBuffer block)
           
 HFileBlockDecodingContext newDataBlockDecodingContext(Compression.Algorithm compressionAlgorithm)
           
 HFileBlockEncodingContext newDataBlockEncodingContext(Compression.Algorithm compressionAlgorithm, DataBlockEncoding encoding, byte[] header)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrefixTreeCodec

public PrefixTreeCodec()
no-arg constructor for reflection

Method Detail

encodeKeyValues

public void encodeKeyValues(ByteBuffer in,
                            boolean includesMvccVersion,
                            HFileBlockEncodingContext blkEncodingCtx)
                     throws IOException
Copied from BufferedDataBlockEncoder. Almost definitely can be improved, but i'm not familiar enough with the concept of the HFileBlockEncodingContext.

Specified by:
encodeKeyValues in interface DataBlockEncoder
Throws:
IOException

decodeKeyValues

public ByteBuffer decodeKeyValues(DataInputStream source,
                                  boolean includesMvccVersion)
                           throws IOException
Specified by:
decodeKeyValues in interface DataBlockEncoder
Throws:
IOException

decodeKeyValues

public ByteBuffer decodeKeyValues(DataInputStream source,
                                  int allocateHeaderLength,
                                  int skipLastBytes,
                                  boolean includesMvccVersion)
                           throws IOException
I don't think this method is called during normal HBase operation, so efficiency is not important.

Specified by:
decodeKeyValues in interface DataBlockEncoder
Throws:
IOException

getFirstKeyInBlock

public ByteBuffer getFirstKeyInBlock(ByteBuffer block)
Specified by:
getFirstKeyInBlock in interface DataBlockEncoder

newDataBlockEncodingContext

public HFileBlockEncodingContext newDataBlockEncodingContext(Compression.Algorithm compressionAlgorithm,
                                                             DataBlockEncoding encoding,
                                                             byte[] header)
Specified by:
newDataBlockEncodingContext in interface DataBlockEncoder

newDataBlockDecodingContext

public HFileBlockDecodingContext newDataBlockDecodingContext(Compression.Algorithm compressionAlgorithm)
Specified by:
newDataBlockDecodingContext in interface DataBlockEncoder

createSeeker

public DataBlockEncoder.EncodedSeeker createSeeker(org.apache.hadoop.io.RawComparator<byte[]> comparator,
                                                   boolean includesMvccVersion)
Is this the correct handling of an illegal comparator? How to prevent that from getting all the way to this point.

Specified by:
createSeeker in interface DataBlockEncoder


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