@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(HFileBlockDecodingContext decodingCtx)
Create a HFileBlock seeker which find KeyValues within a block.
|
ByteBuffer |
decodeKeyValues(DataInputStream source,
HFileBlockDecodingContext decodingCtx)
Decode.
|
void |
encode(Cell cell,
HFileBlockEncodingContext encodingCtx,
DataOutputStream out)
Encodes a KeyValue.
|
void |
endBlockEncoding(HFileBlockEncodingContext encodingCtx,
DataOutputStream out,
byte[] uncompressedBytesWithHeader)
Ends encoding for a block of KeyValues.
|
Cell |
getFirstKeyCellInBlock(ByteBuff block)
Return first key in block as a cell.
|
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,
DataOutputStream out)
Starts encoding for a block of KeyValues.
|
void startBlockEncoding(HFileBlockEncodingContext encodingCtx, DataOutputStream out) throws IOException
endBlockEncoding(HFileBlockEncodingContext, DataOutputStream, byte[])
to finish
encoding of a block.IOException
void encode(Cell cell, HFileBlockEncodingContext encodingCtx, DataOutputStream out) throws IOException
EncodingState.postCellEncode(int, int)
needs to be called to keep
track of the encoded and unencoded data sizeIOException
void endBlockEncoding(HFileBlockEncodingContext encodingCtx, DataOutputStream out, byte[] uncompressedBytesWithHeader) throws IOException
IOException
ByteBuffer decodeKeyValues(DataInputStream source, HFileBlockDecodingContext decodingCtx) throws IOException
source
- Compressed stream of KeyValues.IOException
- If there is an error in source.Cell getFirstKeyCellInBlock(ByteBuff block)
block
- encoded block we want index, the position will not changeDataBlockEncoder.EncodedSeeker createSeeker(HFileBlockDecodingContext decodingCtx)
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 dataCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.