Package org.apache.hadoop.hbase.io
Class HalfStoreFileReader
java.lang.Object
org.apache.hadoop.hbase.regionserver.StoreFileReader
org.apache.hadoop.hbase.io.HalfStoreFileReader
A facade for a
HFile.Reader
that serves up either the
top or bottom half of a HFile where 'bottom' is the first half of the file containing the keys
that sort lowest and 'top' is the second half of the file with keys that sort greater than those
of the bottom half. The top includes the split files midkey, of the key that follows if it does
not exist in the file.
This type works in tandem with the Reference
type. This class is used reading while
Reference is used writing.
This file is not splitable. Calls to midKey()
return null.
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private static final org.slf4j.Logger
private final Cell
protected final byte[]
(package private) final boolean
Fields inherited from class org.apache.hadoop.hbase.regionserver.StoreFileReader
bloomFilterType, conf, deleteFamilyBloomFilter, generalBloomFilter, sequenceID, timeRange
-
Constructor Summary
ConstructorDescriptionHalfStoreFileReader
(ReaderContext context, HFileInfo fileInfo, CacheConfig cacheConf, Reference r, StoreFileInfo storeFileInfo, org.apache.hadoop.conf.Configuration conf) Creates a half file reader for a hfile referred to by an hfilelink. -
Method Summary
Modifier and TypeMethodDescriptionlong
long
The number of Bloom filter entries in this store file, or an estimate thereof, if the Bloom filter is not loaded.getScanner
(boolean cacheBlocks, boolean pread, boolean isCompaction) protected boolean
isTop()
midKey()
boolean
passesKeyRangeFilter
(Scan scan) Checks whether the given scan rowkey range overlaps with the current storefile'sMethods inherited from class org.apache.hadoop.hbase.regionserver.StoreFileReader
close, getBloomFilterType, getComparator, getDeleteFamilyCnt, getHFileMinorVersion, getHFileReader, getHFileVersion, getLastRowKey, getMaxTimestamp, getPrefixLength, getReaderContext, getScanner, getSequenceID, getStoreFileScanner, getTotalBloomSize, getTotalUncompressedBytes, indexSize, isBulkLoaded, isPrimaryReplicaReader, length, loadBloomfilter, loadFileInfo, passesDeleteFamilyBloomFilter, passesGeneralRowColBloomFilter, setBulkLoaded, setSequenceID
-
Field Details
-
LOG
-
top
-
splitkey
-
splitCell
-
firstKey
-
firstKeySeeked
-
-
Constructor Details
-
HalfStoreFileReader
public HalfStoreFileReader(ReaderContext context, HFileInfo fileInfo, CacheConfig cacheConf, Reference r, StoreFileInfo storeFileInfo, org.apache.hadoop.conf.Configuration conf) throws IOException Creates a half file reader for a hfile referred to by an hfilelink.- Parameters:
context
- Reader context infofileInfo
- HFile infocacheConf
- CacheConfigr
- original reference file (contains top or bottom)conf
- Configuration- Throws:
IOException
-
-
Method Details
-
isTop
-
getScanner
- Overrides:
getScanner
in classStoreFileReader
- Returns:
- the underlying HFileScanner
- See Also:
-
passesKeyRangeFilter
Description copied from class:StoreFileReader
Checks whether the given scan rowkey range overlaps with the current storefile's- Overrides:
passesKeyRangeFilter
in classStoreFileReader
- Parameters:
scan
- the scan specification. Used to determine the rowkey range.- Returns:
- true if there is overlap, false otherwise
-
getLastKey
- Overrides:
getLastKey
in classStoreFileReader
-
midKey
- Overrides:
midKey
in classStoreFileReader
- Throws:
IOException
-
getFirstKey
- Overrides:
getFirstKey
in classStoreFileReader
-
getEntries
- Overrides:
getEntries
in classStoreFileReader
-
getFilterEntries
Description copied from class:StoreFileReader
The number of Bloom filter entries in this store file, or an estimate thereof, if the Bloom filter is not loaded. This always returns an upper bound of the number of Bloom filter entries.- Overrides:
getFilterEntries
in classStoreFileReader
- Returns:
- an estimate of the number of Bloom filter entries in this file
-