@InterfaceAudience.Private public class PrefixTreeCodec extends java.lang.Object implements DataBlockEncoder
PrefixTreeEncoder, and decoding is delegated to instances of
CellSearcher. Encoder and decoder instances are
created and recycled by static PtEncoderFactory and PtDecoderFactory.DataBlockEncoder.EncodedSeeker| Constructor and Description |
|---|
PrefixTreeCodec()
no-arg constructor for reflection
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
java.nio.ByteBuffer |
decodeKeyValues(java.io.DataInputStream source,
HFileBlockDecodingContext decodingCtx)
Decode.
|
java.nio.ByteBuffer |
decodeKeyValues(java.io.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.
|
int |
encode(Cell cell,
HFileBlockEncodingContext encodingCtx,
java.io.DataOutputStream out)
Encodes a KeyValue.
|
void |
endBlockEncoding(HFileBlockEncodingContext encodingCtx,
java.io.DataOutputStream out,
byte[] uncompressedBytesWithHeader)
Ends encoding for a block of KeyValues.
|
java.nio.ByteBuffer |
getFirstKeyInBlock(java.nio.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
|
void |
startBlockEncoding(HFileBlockEncodingContext blkEncodingCtx,
java.io.DataOutputStream out)
Starts encoding for a block of KeyValues.
|
public java.nio.ByteBuffer decodeKeyValues(java.io.DataInputStream source,
HFileBlockDecodingContext decodingCtx)
throws java.io.IOException
DataBlockEncoderdecodeKeyValues in interface DataBlockEncodersource - Compressed stream of KeyValues.java.io.IOException - If there is an error in source.public java.nio.ByteBuffer decodeKeyValues(java.io.DataInputStream source,
int allocateHeaderLength,
int skipLastBytes,
HFileBlockDecodingContext decodingCtx)
throws java.io.IOException
java.io.IOExceptionpublic java.nio.ByteBuffer getFirstKeyInBlock(java.nio.ByteBuffer block)
DataBlockEncodergetFirstKeyInBlock in interface DataBlockEncoderblock - encoded block we want index, the position will not changepublic HFileBlockEncodingContext newDataBlockEncodingContext(DataBlockEncoding encoding, byte[] header, HFileContext meta)
DataBlockEncodernewDataBlockEncodingContext in interface DataBlockEncoderencoding - encoding strategy usedheader - header bytes to be written, put a dummy header here if the header
is unknownmeta - HFile meta datapublic HFileBlockDecodingContext newDataBlockDecodingContext(HFileContext meta)
DataBlockEncodernewDataBlockDecodingContext in interface DataBlockEncodermeta - HFile meta datapublic DataBlockEncoder.EncodedSeeker createSeeker(KeyValue.KVComparator comparator, HFileBlockDecodingContext decodingCtx)
createSeeker in interface DataBlockEncodercomparator - what kind of comparison should be usedpublic int encode(Cell cell, HFileBlockEncodingContext encodingCtx, java.io.DataOutputStream out) throws java.io.IOException
DataBlockEncoderencode in interface DataBlockEncoderjava.io.IOExceptionpublic void startBlockEncoding(HFileBlockEncodingContext blkEncodingCtx, java.io.DataOutputStream out) throws java.io.IOException
DataBlockEncoderDataBlockEncoder.endBlockEncoding(HFileBlockEncodingContext, DataOutputStream, byte[]) to finish
encoding of a block.startBlockEncoding in interface DataBlockEncoderjava.io.IOExceptionpublic void endBlockEncoding(HFileBlockEncodingContext encodingCtx, java.io.DataOutputStream out, byte[] uncompressedBytesWithHeader) throws java.io.IOException
DataBlockEncoderendBlockEncoding in interface DataBlockEncoderjava.io.IOException