@InterfaceAudience.Private public class EncodedDataBlock extends Object
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.
|
Iterator<Cell> |
getIterator(int headerSize)
Provides access to compressed value.
|
int |
getSize()
Find the size of minimal buffer that could store compressed data.
|
String |
toString() |
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
public byte[] encodeData()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.