|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.io.hfile.AbstractHFileReader
org.apache.hadoop.hbase.io.hfile.HFileReaderV2
public class HFileReaderV2
HFile
reader for version 2.
Nested Class Summary | |
---|---|
protected static class |
HFileReaderV2.ScannerV2
Implementation of HFileScanner interface. |
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.io.hfile.AbstractHFileReader |
---|
AbstractHFileReader.BlockIndexNotLoadedException, AbstractHFileReader.NotSeekedException, AbstractHFileReader.Scanner |
Field Summary |
---|
Fields inherited from class org.apache.hadoop.hbase.io.hfile.AbstractHFileReader |
---|
avgKeyLen, avgValueLen, blockLoads, cacheConf, cacheHits, closeIStream, comparator, compressAlgo, dataBlockIndexReader, fileInfo, fileSize, fsBlockReader, istream, lastKey, metaBlockIndexReader, metaLoads, name, path, trailer |
Constructor Summary | |
---|---|
HFileReaderV2(org.apache.hadoop.fs.Path path,
FixedFileTrailer trailer,
org.apache.hadoop.fs.FSDataInputStream fsdis,
long size,
boolean closeIStream,
CacheConfig cacheConf)
Opens a HFile. |
Method Summary | |
---|---|
void |
close()
|
void |
close(boolean evictOnClose)
Close method with optional evictOnClose |
DataInput |
getBloomFilterMetadata()
Returns a buffer with the Bloom filter metadata. |
byte[] |
getLastKey()
|
ByteBuffer |
getMetaBlock(String metaBlockName,
boolean cacheBlock)
|
HFileScanner |
getScanner(boolean cacheBlocks,
boolean pread,
boolean isCompaction)
Create a Scanner on this file. |
boolean |
isFileInfoLoaded()
|
byte[] |
midkey()
|
HFileBlock |
readBlock(long dataBlockOffset,
long onDiskBlockSize,
boolean cacheBlock,
boolean pread,
boolean isCompaction)
Read in a file block. |
Methods inherited from class org.apache.hadoop.hbase.io.hfile.AbstractHFileReader |
---|
getColumnFamilyName, getComparator, getCompressionAlgorithm, getDataBlockIndexReader, getEntries, getFirstKey, getFirstRowKey, getLastRowKey, getName, getPath, getScanner, getTrailer, indexSize, length, loadFileInfo, parseCfNameFromPath, toString, toStringFirstKey, toStringLastKey |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HFileReaderV2(org.apache.hadoop.fs.Path path, FixedFileTrailer trailer, org.apache.hadoop.fs.FSDataInputStream fsdis, long size, boolean closeIStream, CacheConfig cacheConf) throws IOException
AbstractHFileReader.loadFileInfo()
.
path
- Path to HFile.trailer
- File trailer.fsdis
- input stream. Caller is responsible for closing the passed
stream.size
- Length of the stream.closeIStream
- Whether to close the stream.cacheConf
- Cache configuration.
IOException
Method Detail |
---|
public HFileScanner getScanner(boolean cacheBlocks, boolean pread, boolean isCompaction)
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.
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?
public ByteBuffer getMetaBlock(String metaBlockName, boolean cacheBlock) throws IOException
metaBlockName
- cacheBlock
- Add block to cache, if found
IOException
public HFileBlock readBlock(long dataBlockOffset, long onDiskBlockSize, boolean cacheBlock, boolean pread, boolean isCompaction) throws IOException
dataBlockOffset
- offset to read.onDiskBlockSize
- size of the blockcacheBlock
- pread
- Use positional read instead of seek+read (positional is better
doing random reads whereas seek+read is better scanning).isCompaction
- is this block being read as part of a compaction
IOException
public byte[] getLastKey()
public byte[] midkey() throws IOException
IOException
public void close() throws IOException
IOException
public void close(boolean evictOnClose) throws IOException
HFile.Reader
IOException
public DataInput getBloomFilterMetadata() throws IOException
IOException
public boolean isFileInfoLoaded()
isFileInfoLoaded
in class AbstractHFileReader
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |