@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(CellComparator comparator,
HFileBlockDecodingContext decodingCtx)
Create a HFileBlock seeker which find KeyValues within a block.
|
ByteBuffer |
decodeKeyValues(DataInputStream source,
HFileBlockDecodingContext decodingCtx)
Decode.
|
int |
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.encodingCtx
- out
- IOException
int encode(Cell cell, HFileBlockEncodingContext encodingCtx, DataOutputStream out) throws IOException
cell
- encodingCtx
- out
- IOException
void endBlockEncoding(HFileBlockEncodingContext encodingCtx, DataOutputStream out, byte[] uncompressedBytesWithHeader) throws IOException
encodingCtx
- out
- uncompressedBytesWithHeader
- IOException
ByteBuffer decodeKeyValues(DataInputStream source, HFileBlockDecodingContext decodingCtx) throws IOException
source
- Compressed stream of KeyValues.decodingCtx
- 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(CellComparator 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 dataCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.