org.apache.hadoop.hbase.io.hfile
Class HFileBlock.FSReaderV2

java.lang.Object
  extended by org.apache.hadoop.hbase.io.hfile.HFileBlock.AbstractFSReader
      extended by org.apache.hadoop.hbase.io.hfile.HFileBlock.FSReaderV2
All Implemented Interfaces:
HFileBlock.FSReader
Enclosing class:
HFileBlock

public static class HFileBlock.FSReaderV2
extends HFileBlock.AbstractFSReader

Reads version 2 blocks from the filesystem.


Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.io.hfile.HFileBlock.AbstractFSReader
compressAlgo, DEFAULT_BUFFER_SIZE, fileSize, istream
 
Constructor Summary
HFileBlock.FSReaderV2(org.apache.hadoop.fs.FSDataInputStream istream, Compression.Algorithm compressAlgo, long fileSize)
           
 
Method Summary
 HFileBlock readBlockData(long offset, long onDiskSizeWithHeaderL, int uncompressedSize, boolean pread)
          Reads a version 2 block.
 
Methods inherited from class org.apache.hadoop.hbase.io.hfile.HFileBlock.AbstractFSReader
blockRange, createBufferedBoundedStream, decompress, readAtOffset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HFileBlock.FSReaderV2

public HFileBlock.FSReaderV2(org.apache.hadoop.fs.FSDataInputStream istream,
                             Compression.Algorithm compressAlgo,
                             long fileSize)
Method Detail

readBlockData

public HFileBlock readBlockData(long offset,
                                long onDiskSizeWithHeaderL,
                                int uncompressedSize,
                                boolean pread)
                         throws IOException
Reads a version 2 block. Tries to do as little memory allocation as possible, using the provided on-disk size.

Parameters:
offset - the offset in the stream to read at
onDiskSizeWithHeaderL - the on-disk size of the block, including the header, or -1 if unknown
uncompressedSize - the uncompressed size of the the block. Always expected to be -1. This parameter is only used in version 1.
pread - whether to use a positional read
Returns:
the newly read block
Throws:
IOException


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