org.apache.hadoop.hbase.io.encoding
Interface HFileBlockEncodingContext

All Known Implementing Classes:
HFileBlockDefaultEncodingContext

public interface HFileBlockEncodingContext

An encoding context that is created by a writer's encoder, and is shared across the writer's whole lifetime.

See Also:
for decoding

Method Summary
 void close()
          Releases the resources used.
 BlockType getBlockType()
           
 Compression.Algorithm getCompression()
           
 DataBlockEncoding getDataBlockEncoding()
           
 byte[] getOnDiskBytesWithHeader()
           
 OutputStream getOutputStreamForEncoder()
           
 byte[] getUncompressedBytesWithHeader()
           
 void postEncoding(BlockType blockType)
          Do any action that needs to be performed after the encoding.
 void setDummyHeader(byte[] headerBytes)
          sets the dummy header bytes
 

Method Detail

getOutputStreamForEncoder

OutputStream getOutputStreamForEncoder()
Returns:
OutputStream to which encoded data is written

getOnDiskBytesWithHeader

byte[] getOnDiskBytesWithHeader()
Returns:
encoded and compressed bytes with header which are ready to write out to disk

getUncompressedBytesWithHeader

byte[] getUncompressedBytesWithHeader()
Returns:
encoded but not heavily compressed bytes with header which can be cached in block cache

getBlockType

BlockType getBlockType()
Returns:
the block type after encoding

getCompression

Compression.Algorithm getCompression()
Returns:
the compression algorithm used by this encoding context

setDummyHeader

void setDummyHeader(byte[] headerBytes)
sets the dummy header bytes


getDataBlockEncoding

DataBlockEncoding getDataBlockEncoding()
Returns:
the DataBlockEncoding encoding used

postEncoding

void postEncoding(BlockType blockType)
                  throws IOException
Do any action that needs to be performed after the encoding. Compression is also included if getCompression() returns non-null compression algorithm

Parameters:
blockType -
Throws:
IOException

close

void close()
Releases the resources used.



Copyright © 2013 The Apache Software Foundation. All Rights Reserved.