@InterfaceAudience.Private public class HFileBlockDefaultEncodingContext extends Object implements HFileBlockEncodingContext
HFileBlockEncodingContext
. It will
compress the data section as one continuous buffer.for the decompression part
Constructor and Description |
---|
HFileBlockDefaultEncodingContext(Compression.Algorithm compressionAlgorithm,
DataBlockEncoding encoding,
byte[] headerBytes) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Releases the compressor this writer uses to compress blocks into the
compressor pool.
|
protected void |
compressAfterEncoding(byte[] uncompressedBytesWithHeader,
BlockType blockType,
byte[] headerBytes) |
void |
compressAfterEncodingWithBlockType(byte[] uncompressedBytesWithHeader,
BlockType blockType) |
BlockType |
getBlockType() |
Compression.Algorithm |
getCompression() |
DataBlockEncoding |
getDataBlockEncoding() |
byte[] |
getOnDiskBytesWithHeader() |
DataOutputStream |
getOutputStreamForEncoder() |
byte[] |
getUncompressedBytesWithHeader() |
void |
postEncoding(BlockType blockType)
Do any action that needs to be performed after the encoding.
|
void |
prepareEncoding()
prepare to start a new encoding.
|
void |
setDummyHeader(byte[] headerBytes)
sets the dummy header bytes
|
public HFileBlockDefaultEncodingContext(Compression.Algorithm compressionAlgorithm, DataBlockEncoding encoding, byte[] headerBytes)
compressionAlgorithm
- compression algorithm usedencoding
- encoding usedheaderBytes
- dummy header bytespublic void setDummyHeader(byte[] headerBytes)
HFileBlockEncodingContext
setDummyHeader
in interface HFileBlockEncodingContext
public void prepareEncoding() throws IOException
IOException
public void postEncoding(BlockType blockType) throws IOException
HFileBlockEncodingContext
HFileBlockEncodingContext.getCompression()
returns non-null
compression algorithmpostEncoding
in interface HFileBlockEncodingContext
IOException
public void compressAfterEncodingWithBlockType(byte[] uncompressedBytesWithHeader, BlockType blockType) throws IOException
uncompressedBytesWithHeader
- blockType
- IOException
protected void compressAfterEncoding(byte[] uncompressedBytesWithHeader, BlockType blockType, byte[] headerBytes) throws IOException
uncompressedBytesWithHeader
- blockType
- headerBytes
- IOException
public byte[] getOnDiskBytesWithHeader()
getOnDiskBytesWithHeader
in interface HFileBlockEncodingContext
public byte[] getUncompressedBytesWithHeader()
getUncompressedBytesWithHeader
in interface HFileBlockEncodingContext
public BlockType getBlockType()
getBlockType
in interface HFileBlockEncodingContext
public void close()
close
in interface HFileBlockEncodingContext
public Compression.Algorithm getCompression()
getCompression
in interface HFileBlockEncodingContext
public DataOutputStream getOutputStreamForEncoder()
getOutputStreamForEncoder
in interface HFileBlockEncodingContext
public DataBlockEncoding getDataBlockEncoding()
getDataBlockEncoding
in interface HFileBlockEncodingContext
DataBlockEncoding
encoding usedCopyright © 2013 The Apache Software Foundation. All Rights Reserved.