@InterfaceAudience.Private abstract class BufferedDataBlockEncoder extends AbstractDataBlockEncoder
Modifier and Type | Class and Description |
---|---|
protected static class |
BufferedDataBlockEncoder.BufferedEncodedSeeker<STATE extends BufferedDataBlockEncoder.SeekerState> |
protected static class |
BufferedDataBlockEncoder.OffheapDecodedExtendedCell |
protected static class |
BufferedDataBlockEncoder.OnheapDecodedCell
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 |
AbstractDataBlockEncoder.AbstractEncodedSeeker
DataBlockEncoder.EncodedSeeker
Modifier and Type | Field and Description |
---|---|
private static int |
INITIAL_KEY_BUFFER_SIZE
TODO: This datablockencoder is dealing in internals of hfileblocks.
|
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)
Returns unencoded size added
|
static int |
compareCommonFamilyPrefix(Cell left,
Cell right,
int familyCommonPrefix) |
static int |
compareCommonQualifierPrefix(Cell left,
Cell right,
int qualCommonPrefix) |
static int |
compareCommonRowPrefix(Cell left,
Cell right,
int rowCommonPrefix)
common prefixes
|
ByteBuffer |
decodeKeyValues(DataInputStream source,
HFileBlockDecodingContext blkDecodingCtx)
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.
|
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) |
void |
startBlockEncoding(HFileBlockEncodingContext blkEncodingCtx,
DataOutputStream out)
Starts encoding for a block of KeyValues.
|
createFirstKeyCell, newDataBlockDecodingContext, newDataBlockEncodingContext, postEncoding
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createSeeker, getFirstKeyCellInBlock
private static int INITIAL_KEY_BUFFER_SIZE
BufferedDataBlockEncoder()
public ByteBuffer decodeKeyValues(DataInputStream source, HFileBlockDecodingContext blkDecodingCtx) throws IOException
DataBlockEncoder
source
- Compressed stream of KeyValues.IOException
- If there is an error in source.public static int compareCommonRowPrefix(Cell left, Cell right, int rowCommonPrefix)
public static int compareCommonFamilyPrefix(Cell left, Cell right, int familyCommonPrefix)
public static int compareCommonQualifierPrefix(Cell left, Cell right, int qualCommonPrefix)
protected final int afterEncodingKeyValue(Cell cell, DataOutputStream out, HFileBlockDefaultEncodingContext encodingCtx) throws IOException
IOException
protected final void afterDecodingKeyValue(DataInputStream source, ByteBuffer dest, HFileBlockDefaultDecodingContext decodingCtx) throws IOException
IOException
protected abstract ByteBuffer internalDecodeKeyValues(DataInputStream source, int allocateHeaderLength, int skipLastBytes, HFileBlockDefaultDecodingContext decodingCtx) throws IOException
IOException
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.public void startBlockEncoding(HFileBlockEncodingContext blkEncodingCtx, DataOutputStream out) throws IOException
DataBlockEncoder
DataBlockEncoder.endBlockEncoding(HFileBlockEncodingContext, DataOutputStream, byte[])
to finish
encoding of a block.IOException
public void encode(Cell cell, HFileBlockEncodingContext encodingCtx, DataOutputStream out) throws IOException
DataBlockEncoder
EncodingState.postCellEncode(int, int)
needs to
be called to keep track of the encoded and unencoded data sizeIOException
public abstract int internalEncode(Cell cell, HFileBlockDefaultEncodingContext encodingCtx, DataOutputStream out) throws IOException
IOException
public void endBlockEncoding(HFileBlockEncodingContext encodingCtx, DataOutputStream out, byte[] uncompressedBytesWithHeader) throws IOException
DataBlockEncoder
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.