@InterfaceAudience.Private public class HFileBlockDefaultEncodingContext extends Object implements HFileBlockEncodingContext
HFileBlockEncodingContext. It will
compress the data section as one continuous buffer.for the decompression part| Modifier and Type | Field and Description |
|---|---|
private BlockType |
blockType |
private ByteArrayOutputStream |
compressedByteStream
Underlying stream to write compressed bytes to
|
private org.apache.hadoop.io.compress.CompressionOutputStream |
compressionStream
Compression output stream
|
private org.apache.hadoop.io.compress.Compressor |
compressor
Compressor, which is also reused between consecutive blocks.
|
private ByteArrayOutputStream |
cryptoByteStream
Underlying stream to write encrypted bytes to
|
private byte[] |
dummyHeader |
private EncodingState |
encoderState |
private DataBlockEncoding |
encodingAlgo |
private HFileContext |
fileContext |
private byte[] |
iv
Initialization vector
|
private TagCompressionContext |
tagCompressionContext |
| Constructor and Description |
|---|
HFileBlockDefaultEncodingContext(DataBlockEncoding encoding,
byte[] headerBytes,
HFileContext fileContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Releases the compressor this writer uses to compress blocks into the
compressor pool.
|
private Bytes |
compressAfterEncoding(byte[] uncompressedBytesWithHeaderBuffer,
int uncompressedBytesWithHeaderOffset,
int uncompressedBytesWithHeaderLength,
byte[] headerBytes) |
Bytes |
compressAndEncrypt(byte[] data,
int offset,
int length) |
BlockType |
getBlockType() |
DataBlockEncoding |
getDataBlockEncoding() |
EncodingState |
getEncodingState() |
HFileContext |
getHFileContext() |
TagCompressionContext |
getTagCompressionContext() |
void |
postEncoding(BlockType blockType)
Do any action that needs to be performed after the encoding.
|
void |
prepareEncoding(DataOutputStream out)
prepare to start a new encoding.
|
void |
setEncodingState(EncodingState state)
Sets the encoding state.
|
void |
setTagCompressionContext(TagCompressionContext tagCompressionContext) |
private final DataBlockEncoding encodingAlgo
private byte[] dummyHeader
private org.apache.hadoop.io.compress.Compressor compressor
private org.apache.hadoop.io.compress.CompressionOutputStream compressionStream
private ByteArrayOutputStream compressedByteStream
private HFileContext fileContext
private TagCompressionContext tagCompressionContext
private ByteArrayOutputStream cryptoByteStream
private byte[] iv
private EncodingState encoderState
public HFileBlockDefaultEncodingContext(DataBlockEncoding encoding, byte[] headerBytes, HFileContext fileContext)
encoding - encoding usedheaderBytes - dummy header bytesfileContext - HFile meta datapublic void prepareEncoding(DataOutputStream out) throws IOException
IOExceptionpublic void postEncoding(BlockType blockType) throws IOException
HFileBlockEncodingContextpostEncoding in interface HFileBlockEncodingContextIOExceptionpublic Bytes compressAndEncrypt(byte[] data, int offset, int length) throws IOException
compressAndEncrypt in interface HFileBlockEncodingContextdata - encoded bytes with headeroffset - the offset in encoded data to start atlength - the number of encoded bytesIOExceptionprivate Bytes compressAfterEncoding(byte[] uncompressedBytesWithHeaderBuffer, int uncompressedBytesWithHeaderOffset, int uncompressedBytesWithHeaderLength, byte[] headerBytes) throws IOException
IOExceptionpublic BlockType getBlockType()
getBlockType in interface HFileBlockEncodingContextpublic void close()
close in interface HFileBlockEncodingContextpublic DataBlockEncoding getDataBlockEncoding()
getDataBlockEncoding in interface HFileBlockEncodingContextDataBlockEncoding encoding usedpublic HFileContext getHFileContext()
getHFileContext in interface HFileBlockEncodingContextpublic TagCompressionContext getTagCompressionContext()
public void setTagCompressionContext(TagCompressionContext tagCompressionContext)
public EncodingState getEncodingState()
getEncodingState in interface HFileBlockEncodingContextpublic void setEncodingState(EncodingState state)
HFileBlockEncodingContextsetEncodingState in interface HFileBlockEncodingContextCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.