|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.io.encoding.EncodedDataBlock
@InterfaceAudience.Private public class EncodedDataBlock
Encapsulates a data block compressed using a particular encoding algorithm. Useful for testing and benchmarking.
Constructor Summary | |
---|---|
EncodedDataBlock(DataBlockEncoder dataBlockEncoder,
DataBlockEncoding encoding,
byte[] rawKVs,
HFileContext meta)
Create a buffer which will be encoded using dataBlockEncoder. |
Method Summary | |
---|---|
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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EncodedDataBlock(DataBlockEncoder dataBlockEncoder, DataBlockEncoding encoding, byte[] rawKVs, HFileContext meta)
dataBlockEncoder
- Algorithm used for compression.encoding
- encoding type usedrawKVs
- meta
- Method Detail |
---|
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
algorithm
IOException
public byte[] encodeData()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |