@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(org.apache.hadoop.conf.Configuration conf,
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.
|
Bytes |
compressAndEncrypt(byte[] data,
int offset,
int length)
Compress and encrypt the supplied encoded block data with header.
|
BlockType |
getBlockType()
Returns the block type after encoding
|
DataBlockEncoding |
getDataBlockEncoding()
Returns the
DataBlockEncoding encoding used |
EncodingState |
getEncodingState()
Returns the encoding state
|
HFileContext |
getHFileContext()
Returns HFile context information
|
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) |
public HFileBlockDefaultEncodingContext(org.apache.hadoop.conf.Configuration conf, DataBlockEncoding encoding, byte[] headerBytes, HFileContext fileContext)
conf
- configuratonencoding
- encoding usedheaderBytes
- dummy header bytesfileContext
- HFile meta datapublic void prepareEncoding(DataOutputStream out) throws IOException
IOException
public void postEncoding(BlockType blockType) throws IOException
HFileBlockEncodingContext
postEncoding
in interface HFileBlockEncodingContext
IOException
public Bytes compressAndEncrypt(byte[] data, int offset, int length) throws IOException
HFileBlockEncodingContext
compressAndEncrypt
in interface HFileBlockEncodingContext
data
- encoded bytes with headeroffset
- the offset in encoded data to start atlength
- the number of encoded bytesIOException
public BlockType getBlockType()
HFileBlockEncodingContext
getBlockType
in interface HFileBlockEncodingContext
public void close()
close
in interface HFileBlockEncodingContext
public DataBlockEncoding getDataBlockEncoding()
HFileBlockEncodingContext
DataBlockEncoding
encoding usedgetDataBlockEncoding
in interface HFileBlockEncodingContext
public HFileContext getHFileContext()
HFileBlockEncodingContext
getHFileContext
in interface HFileBlockEncodingContext
public TagCompressionContext getTagCompressionContext()
public void setTagCompressionContext(TagCompressionContext tagCompressionContext)
public EncodingState getEncodingState()
HFileBlockEncodingContext
getEncodingState
in interface HFileBlockEncodingContext
public void setEncodingState(EncodingState state)
HFileBlockEncodingContext
setEncodingState
in interface HFileBlockEncodingContext
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.