|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.codec.prefixtree.PrefixTreeCodec
@InterfaceAudience.Private public class PrefixTreeCodec
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 ofPrefixTreeEncoder
, 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(KeyValue.KVComparator comparator,
HFileBlockDecodingContext decodingCtx)
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,
HFileBlockDecodingContext decodingCtx)
Decode. |
ByteBuffer |
decodeKeyValues(DataInputStream source,
int allocateHeaderLength,
int skipLastBytes,
HFileBlockDecodingContext decodingCtx)
I don't think this method is called during normal HBase operation, so efficiency is not important. |
void |
encodeKeyValues(ByteBuffer in,
HFileBlockEncodingContext blkEncodingCtx)
Copied from BufferedDataBlockEncoder. |
ByteBuffer |
getFirstKeyInBlock(ByteBuffer block)
Return first key in block. |
HFileBlockDecodingContext |
newDataBlockDecodingContext(HFileContext meta)
Creates an encoder specific decoding context, which will prepare the data before actual decoding |
HFileBlockEncodingContext |
newDataBlockEncodingContext(DataBlockEncoding encoding,
byte[] header,
HFileContext meta)
Creates a encoder specific encoding context |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrefixTreeCodec()
Method Detail |
---|
public void encodeKeyValues(ByteBuffer in, HFileBlockEncodingContext blkEncodingCtx) throws IOException
encodeKeyValues
in interface DataBlockEncoder
in
- Source of KeyValue for compression.blkEncodingCtx
- the encoding context which will contain encoded uncompressed bytes
as well as compressed encoded bytes if compression is enabled, and
also it will reuse resources across multiple calls.
IOException
- If there is an error writing to output stream.public ByteBuffer decodeKeyValues(DataInputStream source, HFileBlockDecodingContext decodingCtx) throws IOException
DataBlockEncoder
decodeKeyValues
in interface DataBlockEncoder
source
- Compressed stream of KeyValues.
IOException
- If there is an error in source.public ByteBuffer decodeKeyValues(DataInputStream source, int allocateHeaderLength, int skipLastBytes, HFileBlockDecodingContext decodingCtx) throws IOException
IOException
public ByteBuffer getFirstKeyInBlock(ByteBuffer block)
DataBlockEncoder
getFirstKeyInBlock
in interface DataBlockEncoder
block
- encoded block we want index, the position will not change
public HFileBlockEncodingContext newDataBlockEncodingContext(DataBlockEncoding encoding, byte[] header, HFileContext meta)
DataBlockEncoder
newDataBlockEncodingContext
in interface DataBlockEncoder
encoding
- encoding strategy usedheader
- header bytes to be written, put a dummy header here if the header
is unknownmeta
- HFile meta data
public HFileBlockDecodingContext newDataBlockDecodingContext(HFileContext meta)
DataBlockEncoder
newDataBlockDecodingContext
in interface DataBlockEncoder
meta
- HFile meta data
public DataBlockEncoder.EncodedSeeker createSeeker(KeyValue.KVComparator comparator, HFileBlockDecodingContext decodingCtx)
createSeeker
in interface DataBlockEncoder
comparator
- what kind of comparison should be used
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |