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
FieldsModifier and TypeFieldDescriptionprivate booleanprivate static final org.slf4j.Loggerprivate final Cellprotected final byte[](package private) final booleanFields inherited from class org.apache.hadoop.hbase.regionserver.StoreFileReader
bloomFilterType, conf, deleteFamilyBloomFilter, generalBloomFilter, sequenceID, timeRange -
Constructor Summary
ConstructorsConstructorDescriptionHalfStoreFileReader(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 TypeMethodDescriptionlonglongThe 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 booleanisTop()midKey()booleanpassesKeyRangeFilter(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:
getScannerin classStoreFileReader- Returns:
- the underlying HFileScanner
- See Also:
-
passesKeyRangeFilter
Description copied from class:StoreFileReaderChecks whether the given scan rowkey range overlaps with the current storefile's- Overrides:
passesKeyRangeFilterin classStoreFileReader- Parameters:
scan- the scan specification. Used to determine the rowkey range.- Returns:
- true if there is overlap, false otherwise
-
getLastKey
- Overrides:
getLastKeyin classStoreFileReader
-
midKey
- Overrides:
midKeyin classStoreFileReader- Throws:
IOException
-
getFirstKey
- Overrides:
getFirstKeyin classStoreFileReader
-
getEntries
- Overrides:
getEntriesin classStoreFileReader
-
getFilterEntries
Description copied from class:StoreFileReaderThe 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:
getFilterEntriesin classStoreFileReader- Returns:
- an estimate of the number of Bloom filter entries in this file
-