@InterfaceAudience.Private public class EncodedDataBlock extends Object
Modifier and Type | Field and Description |
---|---|
private byte[] |
cachedEncodedData |
private DataBlockEncoder |
dataBlockEncoder |
private HFileBlockEncodingContext |
encodingCtx |
private HFileContext |
meta |
private ByteBuffer |
rawBuffer |
private byte[] |
rawKVs |
Constructor and Description |
---|
EncodedDataBlock(DataBlockEncoder dataBlockEncoder,
DataBlockEncoding encoding,
byte[] rawKVs,
HFileContext meta)
Create a buffer which will be encoded using dataBlockEncoder.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
encodeData()
Do the encoding, but do not cache the encoded data.
|
static int |
getCompressedSize(Compression.Algorithm algo,
org.apache.hadoop.io.compress.Compressor compressor,
byte[] inputBuffer,
int offset,
int length)
Find the size of compressed data assuming that buffer will be compressed
using given algorithm.
|
int |
getEncodedCompressedSize(Compression.Algorithm comprAlgo,
org.apache.hadoop.io.compress.Compressor compressor)
Estimate size after second stage of compression (e.g.
|
private byte[] |
getEncodedData() |
Iterator<Cell> |
getIterator(int headerSize)
Provides access to compressed value.
|
int |
getSize()
Find the size of minimal buffer that could store compressed data.
|
private ByteBuffer |
getUncompressedBuffer() |
String |
toString() |
private byte[] rawKVs
private ByteBuffer rawBuffer
private DataBlockEncoder dataBlockEncoder
private byte[] cachedEncodedData
private final HFileBlockEncodingContext encodingCtx
private HFileContext meta
public EncodedDataBlock(DataBlockEncoder dataBlockEncoder, DataBlockEncoding encoding, byte[] rawKVs, HFileContext meta)
dataBlockEncoder
- Algorithm used for compression.encoding
- encoding type usedrawKVs
- meta
- public Iterator<Cell> getIterator(int headerSize)
headerSize
- header size of the block.public int getSize()
public static int getCompressedSize(Compression.Algorithm algo, org.apache.hadoop.io.compress.Compressor compressor, byte[] inputBuffer, int offset, int length) throws IOException
algo
- compression algorithmcompressor
- compressor already requested from codecinputBuffer
- Array to be compressed.offset
- Offset to beginning of the data.length
- Length to be compressed.IOException
public int getEncodedCompressedSize(Compression.Algorithm comprAlgo, org.apache.hadoop.io.compress.Compressor compressor) throws IOException
comprAlgo
- compression algorithm to be used for compressioncompressor
- compressor corresponding to the given compression
algorithmIOException
private byte[] getEncodedData()
private ByteBuffer getUncompressedBuffer()
public byte[] encodeData()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.