public class EncodedDataBlock extends Object
Modifier and Type | Field and Description |
---|---|
protected DataBlockEncoder |
dataBlockEncoder |
Constructor and Description |
---|
EncodedDataBlock(DataBlockEncoder dataBlockEncoder,
boolean includesMemstoreTS)
Create a buffer which will be encoded using dataBlockEncoder.
|
Modifier and Type | Method and Description |
---|---|
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() |
protected DataBlockEncoder dataBlockEncoder
public EncodedDataBlock(DataBlockEncoder dataBlockEncoder, boolean includesMemstoreTS)
dataBlockEncoder
- Algorithm used for compression.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 byte[] getRawKeyValues()
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.