@InterfaceAudience.Private public class DiffKeyDeltaEncoder extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
BufferedDataBlockEncoder.BufferedEncodedSeeker<STATE extends BufferedDataBlockEncoder.SeekerState> |
protected static class |
BufferedDataBlockEncoder.SeekerState |
protected static class |
DiffKeyDeltaEncoder.DiffCompressionState |
protected static class |
DiffKeyDeltaEncoder.DiffSeekerState |
DataBlockEncoder.EncodedSeeker| Constructor and Description |
|---|
DiffKeyDeltaEncoder() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterDecodingKeyValue(DataInputStream source,
ByteBuffer dest,
HFileBlockDefaultDecodingContext decodingCtx) |
protected void |
afterEncodingKeyValue(ByteBuffer in,
DataOutputStream out,
HFileBlockDefaultEncodingContext encodingCtx) |
DataBlockEncoder.EncodedSeeker |
createSeeker(KeyValue.KVComparator comparator,
HFileBlockDecodingContext decodingCtx)
Create a HFileBlock seeker which find KeyValues within a block.
|
ByteBuffer |
decodeKeyValues(DataInputStream source,
HFileBlockDecodingContext blkDecodingCtx)
Decode.
|
void |
encodeKeyValues(ByteBuffer in,
HFileBlockEncodingContext blkEncodingCtx)
Encodes KeyValues.
|
protected static void |
ensureSpace(ByteBuffer out,
int length)
Asserts that there is at least the given amount of unfilled space
remaining in the given buffer.
|
ByteBuffer |
getFirstKeyInBlock(ByteBuffer block)
Return first key in block.
|
protected ByteBuffer |
internalDecodeKeyValues(DataInputStream source,
int allocateHeaderLength,
int skipLastBytes,
HFileBlockDefaultDecodingContext decodingCtx) |
void |
internalEncodeKeyValues(DataOutputStream out,
ByteBuffer in,
HFileBlockDefaultEncodingContext encodingCtx)
Compress KeyValues and write them to output buffer.
|
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
|
String |
toString() |
public void internalEncodeKeyValues(DataOutputStream out, ByteBuffer in, HFileBlockDefaultEncodingContext encodingCtx) throws IOException
out - Where to write compressed data.in - Source of KeyValue for compression.encodingCtx - use the Encoding ctx associated with the current blockIOException - If there is an error writing to output stream.public ByteBuffer getFirstKeyInBlock(ByteBuffer block)
DataBlockEncoderblock - encoded block we want index, the position will not changepublic DataBlockEncoder.EncodedSeeker createSeeker(KeyValue.KVComparator comparator, HFileBlockDecodingContext decodingCtx)
DataBlockEncodercomparator - what kind of comparison should be usedprotected ByteBuffer internalDecodeKeyValues(DataInputStream source, int allocateHeaderLength, int skipLastBytes, HFileBlockDefaultDecodingContext decodingCtx) throws IOException
IOExceptionpublic ByteBuffer decodeKeyValues(DataInputStream source, HFileBlockDecodingContext blkDecodingCtx) throws IOException
DataBlockEncoderdecodeKeyValues in interface DataBlockEncodersource - Compressed stream of KeyValues.IOException - If there is an error in source.protected final void afterEncodingKeyValue(ByteBuffer in, DataOutputStream out, HFileBlockDefaultEncodingContext encodingCtx) throws IOException
IOExceptionprotected final void afterDecodingKeyValue(DataInputStream source, ByteBuffer dest, HFileBlockDefaultDecodingContext decodingCtx) throws IOException
IOExceptionpublic 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 void encodeKeyValues(ByteBuffer in, HFileBlockEncodingContext blkEncodingCtx) throws IOException
DataBlockEncoderencodeKeyValues in interface DataBlockEncoderin - 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.protected static void ensureSpace(ByteBuffer out, int length) throws EncoderBufferTooSmallException
out - typically, the buffer we are writing tolength - the required space in the bufferEncoderBufferTooSmallException - If there are no enough bytes.Copyright © 2014 The Apache Software Foundation. All rights reserved.