|
||||||||||
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
public class EncodedDataBlock
Encapsulates a data block compressed using a particular encoding algorithm. Useful for testing and benchmarking.
Field Summary | |
---|---|
protected DataBlockEncoder |
dataBlockEncoder
|
Constructor Summary | |
---|---|
EncodedDataBlock(DataBlockEncoder dataBlockEncoder,
boolean includesMemstoreTS)
Create a buffer which will be encoded using dataBlockEncoder. |
Method Summary | |
---|---|
void |
addKv(KeyValue kv)
Add KeyValue and compress it. |
int |
checkCompressedSize(org.apache.hadoop.io.compress.Compressor compressor)
Estimate size after second stage of compression (e.g. |
static int |
checkCompressedSize(org.apache.hadoop.io.compress.Compressor compressor,
byte[] buffer,
int offset,
int length)
Find the size of compressed data assuming that buffer will be compressed using given algorithm. |
byte[] |
doCompressData()
Do the compression. |
Iterator<KeyValue> |
getIterator()
Provides access to compressed value. |
byte[] |
getRawKeyValues()
Get uncompressed buffer. |
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 |
Field Detail |
---|
protected DataBlockEncoder dataBlockEncoder
Constructor Detail |
---|
public EncodedDataBlock(DataBlockEncoder dataBlockEncoder, boolean includesMemstoreTS)
dataBlockEncoder
- Algorithm used for compression.Method Detail |
---|
public void addKv(KeyValue kv)
kv
- Item to be added and compressed.public Iterator<KeyValue> getIterator()
public int getSize()
public static int checkCompressedSize(org.apache.hadoop.io.compress.Compressor compressor, byte[] buffer, int offset, int length)
compressor
- Algorithm used for compression.buffer
- Array to be compressed.offset
- Offset to beginning of the data.length
- Length to be compressed.
public int checkCompressedSize(org.apache.hadoop.io.compress.Compressor compressor)
compressor
- Algorithm which will be used for compressions.
public byte[] doCompressData()
public String toString()
toString
in class Object
public byte[] getRawKeyValues()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |