@InterfaceAudience.Private public class HalfStoreFileReader extends StoreFileReader
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.
Modifier and Type | Field and Description |
---|---|
private Optional<Cell> |
firstKey |
private boolean |
firstKeySeeked |
private static org.slf4j.Logger |
LOG |
private Cell |
splitCell |
protected byte[] |
splitkey |
(package private) boolean |
top |
bloomFilterType, deleteFamilyBloomFilter, generalBloomFilter, sequenceID, timeRange
Constructor and Description |
---|
HalfStoreFileReader(ReaderContext context,
HFileInfo fileInfo,
CacheConfig cacheConf,
Reference r,
AtomicInteger refCount,
org.apache.hadoop.conf.Configuration conf)
Creates a half file reader for a hfile referred to by an hfilelink.
|
Modifier and Type | Method and Description |
---|---|
long |
getEntries() |
long |
getFilterEntries()
The number of Bloom filter entries in this store file, or an estimate
thereof, if the Bloom filter is not loaded.
|
Optional<Cell> |
getFirstKey() |
Optional<Cell> |
getLastKey() |
HFileScanner |
getScanner(boolean cacheBlocks,
boolean pread,
boolean isCompaction) |
protected boolean |
isTop() |
Optional<Cell> |
midKey() |
boolean |
passesKeyRangeFilter(Scan scan)
Checks whether the given scan rowkey range overlaps with the current storefile's
|
close, getBloomFilterType, getComparator, getDeleteFamilyCnt, getHFileMinorVersion, getHFileReader, getHFileVersion, getLastRowKey, getMaxTimestamp, getPrefixLength, getReaderContext, getScanner, getSequenceID, getStoreFileScanner, getTotalBloomSize, getTotalUncompressedBytes, indexSize, isBulkLoaded, isPrimaryReplicaReader, length, loadBloomfilter, loadBloomfilter, loadFileInfo, passesDeleteFamilyBloomFilter, passesGeneralRowColBloomFilter, setBulkLoaded, setDeleteFamilyBloomFilterFaulty, setGeneralBloomFilterFaulty, setSequenceID
private static final org.slf4j.Logger LOG
final boolean top
protected final byte[] splitkey
private boolean firstKeySeeked
public HalfStoreFileReader(ReaderContext context, HFileInfo fileInfo, CacheConfig cacheConf, Reference r, AtomicInteger refCount, org.apache.hadoop.conf.Configuration conf) throws IOException
context
- Reader context infofileInfo
- HFile infocacheConf
- CacheConfigr
- original reference file (contains top or bottom)refCount
- reference countconf
- ConfigurationIOException
protected boolean isTop()
public HFileScanner getScanner(boolean cacheBlocks, boolean pread, boolean isCompaction)
getScanner
in class StoreFileReader
cacheBlocks
- should we cache the blocks?pread
- use pread (for concurrent small readers)isCompaction
- is scanner being used for compaction?public boolean passesKeyRangeFilter(Scan scan)
StoreFileReader
passesKeyRangeFilter
in class StoreFileReader
scan
- the scan specification. Used to determine the rowkey range.public Optional<Cell> getLastKey()
getLastKey
in class StoreFileReader
public Optional<Cell> midKey() throws IOException
midKey
in class StoreFileReader
IOException
public Optional<Cell> getFirstKey()
getFirstKey
in class StoreFileReader
public long getEntries()
getEntries
in class StoreFileReader
public long getFilterEntries()
StoreFileReader
getFilterEntries
in class StoreFileReader
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.