@InterfaceAudience.Private public interface DataBlockEncoder
| Modifier and Type | Interface and Description |
|---|---|
static interface |
DataBlockEncoder.EncodedSeeker
An interface which enable to seek while underlying data is encoded.
|
| Modifier and Type | Method and Description |
|---|---|
DataBlockEncoder.EncodedSeeker |
createSeeker(KeyValue.KVComparator comparator,
HFileBlockDecodingContext decodingCtx)
Create a HFileBlock seeker which find KeyValues within a block.
|
java.nio.ByteBuffer |
decodeKeyValues(java.io.DataInputStream source,
HFileBlockDecodingContext decodingCtx)
Decode.
|
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[] headerBytes,
HFileContext meta)
Creates a encoder specific encoding context
|
void |
startBlockEncoding(HFileBlockEncodingContext encodingCtx,
java.io.DataOutputStream out)
Starts encoding for a block of KeyValues.
|
void startBlockEncoding(HFileBlockEncodingContext encodingCtx, java.io.DataOutputStream out) throws java.io.IOException
endBlockEncoding(HFileBlockEncodingContext, DataOutputStream, byte[]) to finish
encoding of a block.encodingCtx - out - java.io.IOExceptionint encode(Cell cell, HFileBlockEncodingContext encodingCtx, java.io.DataOutputStream out) throws java.io.IOException
cell - encodingCtx - out - java.io.IOExceptionvoid endBlockEncoding(HFileBlockEncodingContext encodingCtx, java.io.DataOutputStream out, byte[] uncompressedBytesWithHeader) throws java.io.IOException
encodingCtx - out - uncompressedBytesWithHeader - java.io.IOExceptionjava.nio.ByteBuffer decodeKeyValues(java.io.DataInputStream source,
HFileBlockDecodingContext decodingCtx)
throws java.io.IOException
source - Compressed stream of KeyValues.decodingCtx - java.io.IOException - If there is an error in source.java.nio.ByteBuffer getFirstKeyInBlock(java.nio.ByteBuffer block)
block - encoded block we want index, the position will not changeDataBlockEncoder.EncodedSeeker createSeeker(KeyValue.KVComparator comparator, HFileBlockDecodingContext decodingCtx)
comparator - what kind of comparison should be useddecodingCtx - HFileBlockEncodingContext newDataBlockEncodingContext(DataBlockEncoding encoding, byte[] headerBytes, HFileContext meta)
encoding - encoding strategy usedheaderBytes - header bytes to be written, put a dummy header here if the header
is unknownmeta - HFile meta dataHFileBlockDecodingContext newDataBlockDecodingContext(HFileContext meta)
meta - HFile meta data