|
||||||||||
| 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
public abstract class AbstractHFileReader
Common functionality needed by all versions of HFile readers.
| Nested Class Summary | |
|---|---|
static class |
AbstractHFileReader.BlockIndexNotLoadedException
|
static class |
AbstractHFileReader.NotSeekedException
An exception thrown when an operation requiring a scanner to be seeked is invoked on a scanner that is not seeked. |
protected static class |
AbstractHFileReader.Scanner
|
| Field Summary | |
|---|---|
protected int |
avgKeyLen
Average key length read from file info |
protected int |
avgValueLen
Average value length read from file info |
protected AtomicLong |
blockLoads
|
protected CacheConfig |
cacheConf
Block cache configuration. |
protected AtomicLong |
cacheHits
|
protected boolean |
closeIStream
True if we should close the input stream when done. |
protected org.apache.hadoop.io.RawComparator<byte[]> |
comparator
Key comparator |
protected Compression.Algorithm |
compressAlgo
Filled when we read in the trailer. |
protected HFileBlockIndex.BlockIndexReader |
dataBlockIndexReader
Data block index reader keeping the root data index in memory |
protected org.apache.hadoop.hbase.io.hfile.HFile.FileInfo |
fileInfo
|
protected long |
fileSize
Size of this file. |
protected HFileBlock.FSReader |
fsBlockReader
Filesystem-level block reader for this HFile format version. |
protected org.apache.hadoop.fs.FSDataInputStream |
istream
Stream to read from. |
protected byte[] |
lastKey
Last key in the file. |
protected HFileBlockIndex.BlockIndexReader |
metaBlockIndexReader
Meta block index reader -- always single level |
protected AtomicLong |
metaLoads
|
protected String |
name
File name to be used for block names |
protected org.apache.hadoop.fs.Path |
path
Path of file |
protected FixedFileTrailer |
trailer
|
| Constructor Summary | |
|---|---|
protected |
AbstractHFileReader(org.apache.hadoop.fs.Path path,
FixedFileTrailer trailer,
org.apache.hadoop.fs.FSDataInputStream fsdis,
long fileSize,
boolean closeIStream,
CacheConfig cacheConf)
|
| Method Summary | |
|---|---|
String |
getColumnFamilyName()
|
org.apache.hadoop.io.RawComparator<byte[]> |
getComparator()
|
Compression.Algorithm |
getCompressionAlgorithm()
|
HFileBlockIndex.BlockIndexReader |
getDataBlockIndexReader()
|
long |
getEntries()
|
byte[] |
getFirstKey()
|
byte[] |
getFirstRowKey()
TODO left from HFile version 1: move this to StoreFile after Ryan's
patch goes in to eliminate KeyValue here. |
byte[] |
getLastRowKey()
TODO left from HFile version 1: move this to StoreFile after
Ryan's patch goes in to eliminate KeyValue here. |
String |
getName()
Returns this reader's "name". |
org.apache.hadoop.fs.Path |
getPath()
|
HFileScanner |
getScanner(boolean cacheBlocks,
boolean pread)
Create a Scanner on this file. |
FixedFileTrailer |
getTrailer()
|
long |
indexSize()
|
abstract boolean |
isFileInfoLoaded()
|
long |
length()
|
org.apache.hadoop.hbase.io.hfile.HFile.FileInfo |
loadFileInfo()
|
static String |
parseCfNameFromPath(String path)
Parse the HFile path to figure out which table and column family it belongs to. |
String |
toString()
|
protected String |
toStringFirstKey()
|
protected String |
toStringLastKey()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.hadoop.hbase.io.hfile.HFile.Reader |
|---|
close, getBloomFilterMetadata, getLastKey, getMetaBlock, getScanner, midkey |
| Methods inherited from interface java.io.Closeable |
|---|
close |
| Methods inherited from interface org.apache.hadoop.hbase.io.hfile.HFile.CachingBlockReader |
|---|
readBlock |
| Field Detail |
|---|
protected HFileBlock.FSReader fsBlockReader
protected org.apache.hadoop.fs.FSDataInputStream istream
protected final boolean closeIStream
protected HFileBlockIndex.BlockIndexReader dataBlockIndexReader
protected HFileBlockIndex.BlockIndexReader metaBlockIndexReader
protected final FixedFileTrailer trailer
protected final Compression.Algorithm compressAlgo
protected byte[] lastKey
protected int avgKeyLen
protected int avgValueLen
protected org.apache.hadoop.io.RawComparator<byte[]> comparator
protected final long fileSize
protected final CacheConfig cacheConf
protected AtomicLong cacheHits
protected AtomicLong blockLoads
protected AtomicLong metaLoads
protected final org.apache.hadoop.fs.Path path
protected final String name
protected org.apache.hadoop.hbase.io.hfile.HFile.FileInfo fileInfo
| Constructor Detail |
|---|
protected AbstractHFileReader(org.apache.hadoop.fs.Path path,
FixedFileTrailer trailer,
org.apache.hadoop.fs.FSDataInputStream fsdis,
long fileSize,
boolean closeIStream,
CacheConfig cacheConf)
| Method Detail |
|---|
protected String toStringFirstKey()
protected String toStringLastKey()
public static String parseCfNameFromPath(String path)
path - HFile path namepublic abstract boolean isFileInfoLoaded()
public String toString()
toString in class Objectpublic long length()
length in interface HFile.Reader
public HFileScanner getScanner(boolean cacheBlocks,
boolean pread)
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. NOTE: Do not use this overload of getScanner for
compactions.
getScanner in interface HFile.ReadercacheBlocks - 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).
public byte[] getFirstKey()
getFirstKey in interface HFile.Readerpublic byte[] getFirstRowKey()
HFile version 1: move this to StoreFile after Ryan's
patch goes in to eliminate KeyValue here.
getFirstRowKey in interface HFile.Readerpublic byte[] getLastRowKey()
HFile version 1: move this to StoreFile after
Ryan's patch goes in to eliminate KeyValue here.
getLastRowKey in interface HFile.Readerpublic long getEntries()
getEntries in interface HFile.Readerpublic org.apache.hadoop.io.RawComparator<byte[]> getComparator()
getComparator in interface HFile.Readerpublic Compression.Algorithm getCompressionAlgorithm()
getCompressionAlgorithm in interface HFile.Readerpublic long indexSize()
indexSize in interface HFile.Readerpublic String getName()
HFile.Reader
getName in interface HFile.Readerpublic HFileBlockIndex.BlockIndexReader getDataBlockIndexReader()
getDataBlockIndexReader in interface HFile.Readerpublic String getColumnFamilyName()
getColumnFamilyName in interface HFile.Readerpublic FixedFileTrailer getTrailer()
getTrailer in interface HFile.Reader
public org.apache.hadoop.hbase.io.hfile.HFile.FileInfo loadFileInfo()
throws IOException
loadFileInfo in interface HFile.ReaderIOExceptionpublic org.apache.hadoop.fs.Path getPath()
getPath in interface HFile.Reader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||