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

All Known Implementing Classes:
HFileBlock.AbstractFSReader, HFileBlock.FSReaderV1, HFileBlock.FSReaderV2
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.
 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.

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


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