org.apache.hadoop.hbase.io.encoding
Class HFileBlockDefaultDecodingContext

java.lang.Object
  extended by org.apache.hadoop.hbase.io.encoding.HFileBlockDefaultDecodingContext
All Implemented Interfaces:
HFileBlockDecodingContext

public class HFileBlockDefaultDecodingContext
extends Object
implements HFileBlockDecodingContext

A default implementation of HFileBlockDecodingContext. It assumes the block data section is compressed as a whole.

See Also:
for the default compression context

Constructor Summary
HFileBlockDefaultDecodingContext(Compression.Algorithm compressAlgo)
           
 
Method Summary
 Compression.Algorithm getCompression()
           
 void prepareDecoding(int onDiskSizeWithoutHeader, int uncompressedSizeWithoutHeader, ByteBuffer blockBufferWithoutHeader, byte[] onDiskBlock, int offset)
          Perform all actions that need to be done before the encoder's real decoding process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HFileBlockDefaultDecodingContext

public HFileBlockDefaultDecodingContext(Compression.Algorithm compressAlgo)
Method Detail

prepareDecoding

public void prepareDecoding(int onDiskSizeWithoutHeader,
                            int uncompressedSizeWithoutHeader,
                            ByteBuffer blockBufferWithoutHeader,
                            byte[] onDiskBlock,
                            int offset)
                     throws IOException
Description copied from interface: HFileBlockDecodingContext
Perform all actions that need to be done before the encoder's real decoding process. Decompression needs to be done if HFileBlockDecodingContext.getCompression() returns a valid compression algorithm.

Specified by:
prepareDecoding in interface HFileBlockDecodingContext
Parameters:
onDiskSizeWithoutHeader - numBytes after block and encoding headers
uncompressedSizeWithoutHeader - numBytes without header required to store the block after decompressing (not decoding)
blockBufferWithoutHeader - ByteBuffer pointed after the header but before the data
onDiskBlock - on disk bytes to be decoded
offset - data start offset in onDiskBlock
Throws:
IOException

getCompression

public Compression.Algorithm getCompression()
Specified by:
getCompression in interface HFileBlockDecodingContext
Returns:
the compression algorithm used by this decoding context


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