org.apache.hadoop.hbase.io.hfile
Interface HFileBlock.FSReader

Enclosing class:
HFileBlock

public static interface HFileBlock.FSReader

A full-fledged reader with iteration ability.


Method Summary
 HFileBlock.BlockIterator blockRange(long startOffset, long endOffset)
          Creates a block iterator over the given portion of the HFile.
 void closeStreams()
          Closes the backing streams
 HFileBlockDecodingContext getBlockDecodingContext()
          Get a decoder for BlockType.ENCODED_DATA blocks from this file.
 HFileBlockDecodingContext getDefaultBlockDecodingContext()
          Get the default decoder for blocks from this file.
 HFileBlock readBlockData(long offset, long onDiskSize, int uncompressedSize, boolean pread)
          Reads the block at the given offset in the file with the given on-disk size and uncompressed size.
 

Method Detail

readBlockData

HFileBlock readBlockData(long offset,
                         long onDiskSize,
                         int uncompressedSize,
                         boolean pread)
                         throws IOException
Reads the block at the given offset in the file with the given on-disk size and uncompressed size.

Parameters:
offset -
onDiskSize - the on-disk size of the entire block, including all applicable headers, or -1 if unknown
uncompressedSize - the uncompressed size of the compressed part of the block, or -1 if unknown
Returns:
the newly read block
Throws:
IOException

blockRange

HFileBlock.BlockIterator blockRange(long startOffset,
                                    long endOffset)
Creates a block iterator over the given portion of the HFile. The iterator returns blocks starting with offset such that offset <= startOffset < endOffset. Returned blocks are always unpacked.

Parameters:
startOffset - the offset of the block to start iteration with
endOffset - the offset to end iteration at (exclusive)
Returns:
an iterator of blocks between the two given offsets

closeStreams

void closeStreams()
                  throws IOException
Closes the backing streams

Throws:
IOException

getBlockDecodingContext

HFileBlockDecodingContext getBlockDecodingContext()
Get a decoder for BlockType.ENCODED_DATA blocks from this file.


getDefaultBlockDecodingContext

HFileBlockDecodingContext getDefaultBlockDecodingContext()
Get the default decoder for blocks from this file.



Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.