@InterfaceAudience.Private abstract class BufferedDataBlockEncoder extends Object implements DataBlockEncoder
| Modifier and Type | Class and Description |
|---|---|
private static class |
BufferedDataBlockEncoder.BufferedDataBlockEncodingState |
protected static class |
BufferedDataBlockEncoder.BufferedEncodedSeeker<STATE extends BufferedDataBlockEncoder.SeekerState> |
protected static class |
BufferedDataBlockEncoder.ClonedSeekerState
Copies only the key part of the keybuffer by doing a deep copy and passes the
seeker state members for taking a clone.
|
protected static class |
BufferedDataBlockEncoder.SeekerState |
DataBlockEncoder.EncodedSeeker| Modifier and Type | Field and Description |
|---|---|
private static int |
INITIAL_KEY_BUFFER_SIZE |
| Constructor and Description |
|---|
BufferedDataBlockEncoder() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterDecodingKeyValue(DataInputStream source,
ByteBuffer dest,
HFileBlockDefaultDecodingContext decodingCtx) |
protected int |
afterEncodingKeyValue(Cell cell,
DataOutputStream out,
HFileBlockDefaultEncodingContext encodingCtx) |
ByteBuffer |
decodeKeyValues(DataInputStream source,
HFileBlockDecodingContext blkDecodingCtx)
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.
|
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.
|
protected abstract ByteBuffer |
internalDecodeKeyValues(DataInputStream source,
int allocateHeaderLength,
int skipLastBytes,
HFileBlockDefaultDecodingContext decodingCtx) |
abstract int |
internalEncode(Cell cell,
HFileBlockDefaultEncodingContext encodingCtx,
DataOutputStream out) |
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,
DataOutputStream out)
Starts encoding for a block of KeyValues.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateSeeker, getFirstKeyInBlockpublic 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 int afterEncodingKeyValue(Cell cell, DataOutputStream out, HFileBlockDefaultEncodingContext encodingCtx) throws IOException
cell - out - encodingCtx - 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 dataprotected abstract ByteBuffer internalDecodeKeyValues(DataInputStream source, int allocateHeaderLength, int skipLastBytes, HFileBlockDefaultDecodingContext decodingCtx) throws IOException
IOExceptionprotected 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.public void startBlockEncoding(HFileBlockEncodingContext blkEncodingCtx, DataOutputStream out) throws IOException
DataBlockEncoderDataBlockEncoder.endBlockEncoding(HFileBlockEncodingContext, DataOutputStream, byte[]) to finish
encoding of a block.startBlockEncoding in interface DataBlockEncoderIOExceptionpublic int encode(Cell cell, HFileBlockEncodingContext encodingCtx, DataOutputStream out) throws IOException
DataBlockEncoderencode in interface DataBlockEncoderIOExceptionpublic abstract int internalEncode(Cell cell, HFileBlockDefaultEncodingContext encodingCtx, DataOutputStream out) throws IOException
IOExceptionpublic void endBlockEncoding(HFileBlockEncodingContext encodingCtx, DataOutputStream out, byte[] uncompressedBytesWithHeader) throws IOException
DataBlockEncoderendBlockEncoding in interface DataBlockEncoderIOExceptionCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.