public abstract class AbstractHFileReader extends SchemaConfigured implements HFile.Reader
HFile
readers.Modifier and Type | Class and Description |
---|---|
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 |
Modifier and Type | Field and Description |
---|---|
protected int |
avgKeyLen
Average key length read from file info
|
protected int |
avgValueLen
Average value length read from file info
|
protected CacheConfig |
cacheConf
Block cache configuration.
|
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 HFileDataBlockEncoder |
dataBlockEncoder
What kind of data block encoding should be used while reading, writing,
and handling cache.
|
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 HFileSystem |
hfs
The filesystem used for accesing data
|
protected org.apache.hadoop.fs.FSDataInputStream |
istream
Stream to read from.
|
protected org.apache.hadoop.fs.FSDataInputStream |
istreamNoFsChecksum
The file system stream of the underlying
HFile that
does not do checksum verification in the file system |
protected byte[] |
lastKey
Last key in the file.
|
protected HFileBlockIndex.BlockIndexReader |
metaBlockIndexReader
Meta block index reader -- always single level
|
protected String |
name
File name to be used for block names
|
protected org.apache.hadoop.fs.Path |
path
Path of file
|
protected FixedFileTrailer |
trailer |
SCHEMA_CONFIGURED_UNALIGNED_HEAP_SIZE
Modifier | Constructor and Description |
---|---|
protected |
AbstractHFileReader(org.apache.hadoop.fs.Path path,
FixedFileTrailer trailer,
org.apache.hadoop.fs.FSDataInputStream fsdis,
org.apache.hadoop.fs.FSDataInputStream fsdisNoFsChecksum,
long fileSize,
boolean closeIStream,
CacheConfig cacheConf,
HFileSystem hfs) |
protected |
AbstractHFileReader(org.apache.hadoop.fs.Path path,
FixedFileTrailer trailer,
org.apache.hadoop.fs.FSDataInputStream fsdis,
long fileSize,
boolean closeIStream,
CacheConfig cacheConf) |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.io.RawComparator<byte[]> |
getComparator() |
Compression.Algorithm |
getCompressionAlgorithm() |
HFileBlockIndex.BlockIndexReader |
getDataBlockIndexReader() |
DataBlockEncoding |
getEncodingOnDisk() |
long |
getEntries() |
byte[] |
getFirstKey() |
byte[] |
getFirstRowKey()
|
byte[] |
getLastRowKey()
|
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() |
boolean |
hasMVCCInfo() |
long |
indexSize() |
abstract boolean |
isFileInfoLoaded() |
long |
length() |
org.apache.hadoop.hbase.io.hfile.HFile.FileInfo |
loadFileInfo() |
String |
toString() |
protected String |
toStringFirstKey() |
protected String |
toStringLastKey() |
createUnknown, getColumnFamilyName, getSchemaMetrics, getTableName, heapSize, isSchemaConfigured, passSchemaMetricsTo, resetSchemaMetricsConf, schemaConfAsJSON, schemaConfigurationChanged
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, getColumnFamilyName, getDeleteBloomFilterMetadata, getGeneralBloomFilterMetadata, getLastKey, getMetaBlock, getScanner, midkey
readBlock
getSchemaMetrics, getTableName
protected HFileBlock.FSReader fsBlockReader
protected org.apache.hadoop.fs.FSDataInputStream istream
protected org.apache.hadoop.fs.FSDataInputStream istreamNoFsChecksum
HFile
that
does not do checksum verification in the file systemprotected final boolean closeIStream
protected HFileBlockIndex.BlockIndexReader dataBlockIndexReader
protected HFileBlockIndex.BlockIndexReader metaBlockIndexReader
protected final FixedFileTrailer trailer
protected final Compression.Algorithm compressAlgo
protected HFileDataBlockEncoder dataBlockEncoder
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 final org.apache.hadoop.fs.Path path
protected final String name
protected org.apache.hadoop.hbase.io.hfile.HFile.FileInfo fileInfo
protected HFileSystem hfs
protected AbstractHFileReader(org.apache.hadoop.fs.Path path, FixedFileTrailer trailer, org.apache.hadoop.fs.FSDataInputStream fsdis, long fileSize, boolean closeIStream, CacheConfig cacheConf)
protected AbstractHFileReader(org.apache.hadoop.fs.Path path, FixedFileTrailer trailer, org.apache.hadoop.fs.FSDataInputStream fsdis, org.apache.hadoop.fs.FSDataInputStream fsdisNoFsChecksum, long fileSize, boolean closeIStream, CacheConfig cacheConf, HFileSystem hfs)
protected String toStringFirstKey()
protected String toStringLastKey()
public abstract boolean isFileInfoLoaded()
public 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.Reader
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).public byte[] getFirstKey()
getFirstKey
in interface HFile.Reader
public byte[] getFirstRowKey()
HFile
version 1: move this to StoreFile after Ryan's
patch goes in to eliminate KeyValue
here.getFirstRowKey
in interface HFile.Reader
public byte[] getLastRowKey()
HFile
version 1: move this to StoreFile after
Ryan's patch goes in to eliminate KeyValue
here.getLastRowKey
in interface HFile.Reader
public long getEntries()
getEntries
in interface HFile.Reader
public org.apache.hadoop.io.RawComparator<byte[]> getComparator()
getComparator
in interface HFile.Reader
public Compression.Algorithm getCompressionAlgorithm()
getCompressionAlgorithm
in interface HFile.Reader
public long indexSize()
indexSize
in interface HFile.Reader
public String getName()
HFile.Reader
getName
in interface HFile.Reader
public HFileBlockIndex.BlockIndexReader getDataBlockIndexReader()
getDataBlockIndexReader
in interface HFile.Reader
public FixedFileTrailer getTrailer()
getTrailer
in interface HFile.Reader
public org.apache.hadoop.hbase.io.hfile.HFile.FileInfo loadFileInfo() throws IOException
loadFileInfo
in interface HFile.Reader
IOException
public org.apache.hadoop.fs.Path getPath()
getPath
in interface HFile.Reader
public DataBlockEncoding getEncodingOnDisk()
getEncodingOnDisk
in interface HFile.Reader
public boolean hasMVCCInfo()
hasMVCCInfo
in interface HFile.Reader
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.