org.apache.hadoop.hbase.io.hfile
Class HFileReaderV3

java.lang.Object
  extended by org.apache.hadoop.hbase.io.hfile.AbstractHFileReader
      extended by org.apache.hadoop.hbase.io.hfile.HFileReaderV2
          extended by org.apache.hadoop.hbase.io.hfile.HFileReaderV3
All Implemented Interfaces:
Closeable, org.apache.hadoop.conf.Configurable, HFile.CachingBlockReader, HFile.Reader

@InterfaceAudience.Private
public class HFileReaderV3
extends HFileReaderV2

HFile reader for version 3.


Nested Class Summary
protected static class HFileReaderV3.EncodedScannerV3
          ScannerV3 that operates on encoded data blocks.
protected static class HFileReaderV3.ScannerV3
          Implementation of HFileScanner interface.
 
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.io.hfile.HFileReaderV2
HFileReaderV2.AbstractScannerV2, HFileReaderV2.EncodedScannerV2, HFileReaderV2.ScannerV2
 
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.io.hfile.AbstractHFileReader
AbstractHFileReader.BlockIndexNotLoadedException, AbstractHFileReader.NotSeekedException, AbstractHFileReader.Scanner
 
Field Summary
static int MAX_MINOR_VERSION
           
 
Fields inherited from class org.apache.hadoop.hbase.io.hfile.HFileReaderV2
decodeMemstoreTS, fsBlockReader, hfileContext, includesMemstoreTS, KEY_VALUE_LEN_SIZE, MINOR_VERSION_NO_CHECKSUM, MINOR_VERSION_WITH_CHECKSUM, PBUF_TRAILER_MINOR_VERSION
 
Fields inherited from class org.apache.hadoop.hbase.io.hfile.AbstractHFileReader
avgKeyLen, avgValueLen, cacheConf, comparator, compressAlgo, conf, dataBlockEncoder, dataBlockIndexReader, fileInfo, fileSize, hfs, istream, istreamNoFsChecksum, lastKey, metaBlockIndexReader, name, path, trailer
 
Constructor Summary
HFileReaderV3(org.apache.hadoop.fs.Path path, FixedFileTrailer trailer, FSDataInputStreamWrapper fsdis, long size, CacheConfig cacheConf, HFileSystem hfs, org.apache.hadoop.conf.Configuration conf)
          Opens a HFile.
 
Method Summary
protected  HFileContext createHFileContext(FSDataInputStreamWrapper fsdis, long fileSize, HFileSystem hfs, org.apache.hadoop.fs.Path path, FixedFileTrailer trailer)
           
 int getMajorVersion()
           
 HFileScanner getScanner(boolean cacheBlocks, boolean pread, boolean isCompaction)
          Create a Scanner on this file.
 
Methods inherited from class org.apache.hadoop.hbase.io.hfile.HFileReaderV2
close, close, getDeleteBloomFilterMetadata, getFileContext, getGeneralBloomFilterMetadata, getLastKey, getMetaBlock, hasMVCCInfo, isFileInfoLoaded, midkey, readBlock, shouldIncludeMemstoreTS
 
Methods inherited from class org.apache.hadoop.hbase.io.hfile.AbstractHFileReader
getComparator, getCompressionAlgorithm, getConf, getDataBlockEncoding, getDataBlockIndexReader, getEntries, getFirstKey, getFirstRowKey, getLastRowKey, getName, getPath, getScanner, getTrailer, indexSize, length, loadFileInfo, setConf, toString, toStringFirstKey, toStringLastKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_MINOR_VERSION

public static final int MAX_MINOR_VERSION
See Also:
Constant Field Values
Constructor Detail

HFileReaderV3

public HFileReaderV3(org.apache.hadoop.fs.Path path,
                     FixedFileTrailer trailer,
                     FSDataInputStreamWrapper fsdis,
                     long size,
                     CacheConfig cacheConf,
                     HFileSystem hfs,
                     org.apache.hadoop.conf.Configuration conf)
              throws IOException
Opens a HFile. You must load the index before you can use it by calling AbstractHFileReader.loadFileInfo().

Parameters:
path - Path to HFile.
trailer - File trailer.
fsdis - input stream.
size - Length of the stream.
cacheConf - Cache configuration.
hfs - The file system.
conf - Configuration
Throws:
IOException
Method Detail

createHFileContext

protected HFileContext createHFileContext(FSDataInputStreamWrapper fsdis,
                                          long fileSize,
                                          HFileSystem hfs,
                                          org.apache.hadoop.fs.Path path,
                                          FixedFileTrailer trailer)
                                   throws IOException
Overrides:
createHFileContext in class HFileReaderV2
Throws:
IOException

getScanner

public HFileScanner getScanner(boolean cacheBlocks,
                               boolean pread,
                               boolean isCompaction)
Create a Scanner on this file. No seeks or reads are done on creation. Call HFileScanner.seekTo(byte[]) to position an start the read. There is nothing to clean up in a Scanner. Letting go of your references to the scanner is sufficient.

Specified by:
getScanner in interface HFile.Reader
Overrides:
getScanner in class HFileReaderV2
Parameters:
cacheBlocks - True if we should cache blocks read in by this scanner.
pread - Use positional read rather than seek+read if true (pread is better for random reads, seek+read is better scanning).
isCompaction - is scanner being used for a compaction?
Returns:
Scanner on this file.

getMajorVersion

public int getMajorVersion()
Overrides:
getMajorVersion in class HFileReaderV2


Copyright © 2015 The Apache Software Foundation. All rights reserved.