@InterfaceAudience.LimitedPrivate(value="Phoenix") @InterfaceStability.Evolving public class StoreFileReader extends Object
Modifier and Type | Field and Description |
---|---|
protected BloomType |
bloomFilterType |
private boolean |
bulkLoadResult |
private ReaderContext |
context |
protected BloomFilter |
deleteFamilyBloomFilter |
private long |
deleteFamilyCnt |
protected BloomFilter |
generalBloomFilter |
private byte[] |
lastBloomKey |
private KeyValue.KeyOnlyKeyValue |
lastBloomKeyOnlyKV |
private static org.slf4j.Logger |
LOG |
private int |
prefixLength |
private HFile.Reader |
reader |
private AtomicInteger |
refCount |
protected long |
sequenceID |
private boolean |
skipResetSeqId |
protected TimeRange |
timeRange |
Modifier | Constructor and Description |
---|---|
(package private) |
StoreFileReader()
ONLY USE DEFAULT CONSTRUCTOR FOR UNIT TESTS
|
private |
StoreFileReader(HFile.Reader reader,
AtomicInteger refCount,
ReaderContext context) |
|
StoreFileReader(ReaderContext context,
HFileInfo fileInfo,
CacheConfig cacheConf,
AtomicInteger refCount,
org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
private boolean |
checkGeneralBloomFilter(byte[] key,
Cell kvKey,
BloomFilter bloomFilter) |
void |
close(boolean evictOnClose) |
(package private) void |
copyFields(StoreFileReader storeFileReader) |
(package private) void |
disableBloomFilterForTesting() |
BloomType |
getBloomFilterType() |
CellComparator |
getComparator() |
long |
getDeleteFamilyCnt() |
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() |
(package private) BloomFilter |
getGeneralBloomFilter() |
int |
getHFileMinorVersion() |
HFile.Reader |
getHFileReader() |
int |
getHFileVersion() |
Optional<Cell> |
getLastKey() |
Optional<byte[]> |
getLastRowKey() |
long |
getMaxTimestamp() |
int |
getPrefixLength() |
ReaderContext |
getReaderContext() |
(package private) int |
getRefCount()
Return the ref count associated with the reader whenever a scanner associated with the
reader is opened.
|
HFileScanner |
getScanner(boolean cacheBlocks,
boolean pread)
Deprecated.
since 2.0.0 and will be removed in 3.0.0. Do not write further code which depends
on this call. Instead use getStoreFileScanner() which uses the StoreFileScanner
class/interface which is the preferred way to scan a store with higher level concepts.
|
HFileScanner |
getScanner(boolean cacheBlocks,
boolean pread,
boolean isCompaction)
Deprecated.
since 2.0.0 and will be removed in 3.0.0. Do not write further code which depends
on this call. Instead use getStoreFileScanner() which uses the StoreFileScanner
class/interface which is the preferred way to scan a store with higher level concepts.
|
long |
getSequenceID() |
StoreFileScanner |
getStoreFileScanner(boolean cacheBlocks,
boolean pread,
boolean isCompaction,
long readPt,
long scannerOrder,
boolean canOptimizeForNonNullColumn)
Get a scanner to scan over this StoreFile.
|
long |
getTotalBloomSize() |
long |
getTotalUncompressedBytes() |
(package private) long |
getUncompressedDataIndexSize() |
(package private) void |
incrementRefCount()
Indicate that the scanner has started reading with this reader.
|
long |
indexSize() |
boolean |
isBulkLoaded() |
boolean |
isPrimaryReplicaReader() |
(package private) boolean |
isSkipResetSeqId() |
long |
length() |
void |
loadBloomfilter() |
void |
loadBloomfilter(BlockType blockType) |
Map<byte[],byte[]> |
loadFileInfo() |
Optional<Cell> |
midKey() |
(package private) boolean |
passesBloomFilter(Scan scan,
SortedSet<byte[]> columns)
Checks whether the given scan passes the Bloom filter (if present).
|
boolean |
passesDeleteFamilyBloomFilter(byte[] row,
int rowOffset,
int rowLen) |
private boolean |
passesGeneralRowBloomFilter(byte[] row,
int rowOffset,
int rowLen)
A method for checking Bloom filters.
|
boolean |
passesGeneralRowColBloomFilter(Cell cell)
A method for checking Bloom filters.
|
private boolean |
passesGeneralRowPrefixBloomFilter(Scan scan)
A method for checking Bloom filters.
|
boolean |
passesKeyRangeFilter(Scan scan)
Checks whether the given scan rowkey range overlaps with the current storefile's
|
(package private) boolean |
passesTimerangeFilter(TimeRange tr,
long oldestUnexpiredTS)
Check if this storeFile may contain keys within the TimeRange that
have not expired (i.e.
|
(package private) void |
readCompleted()
Indicate that the scanner has finished reading with this reader.
|
private void |
setBloomFilterFaulty(BlockType blockType) |
void |
setBulkLoaded(boolean bulkLoadResult) |
void |
setDeleteFamilyBloomFilterFaulty() |
void |
setGeneralBloomFilterFaulty() |
void |
setSequenceID(long sequenceID) |
(package private) void |
setSkipResetSeqId(boolean skipResetSeqId) |
private static final org.slf4j.Logger LOG
protected BloomFilter generalBloomFilter
protected BloomFilter deleteFamilyBloomFilter
protected BloomType bloomFilterType
private final HFile.Reader reader
protected long sequenceID
private byte[] lastBloomKey
private long deleteFamilyCnt
private boolean bulkLoadResult
private KeyValue.KeyOnlyKeyValue lastBloomKeyOnlyKV
private boolean skipResetSeqId
private int prefixLength
private final AtomicInteger refCount
private final ReaderContext context
private StoreFileReader(HFile.Reader reader, AtomicInteger refCount, ReaderContext context)
public StoreFileReader(ReaderContext context, HFileInfo fileInfo, CacheConfig cacheConf, AtomicInteger refCount, org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
StoreFileReader()
void copyFields(StoreFileReader storeFileReader) throws IOException
IOException
public boolean isPrimaryReplicaReader()
public CellComparator getComparator()
public StoreFileScanner getStoreFileScanner(boolean cacheBlocks, boolean pread, boolean isCompaction, long readPt, long scannerOrder, boolean canOptimizeForNonNullColumn)
cacheBlocks
- should this scanner cache blocks?pread
- use pread (for highly concurrent small readers)isCompaction
- is scanner being used for compaction?scannerOrder
- Order of this scanner relative to other scanners. See
KeyValueScanner.getScannerOrder()
.canOptimizeForNonNullColumn
- true
if we can make sure there is no null column,
otherwise false
. This is a hint for optimization.int getRefCount()
void incrementRefCount()
void readCompleted()
@Deprecated public HFileScanner getScanner(boolean cacheBlocks, boolean pread)
cacheBlocks
- should we cache the blocks?pread
- use pread (for concurrent small readers)@Deprecated public HFileScanner getScanner(boolean cacheBlocks, boolean pread, boolean isCompaction)
cacheBlocks
- should we cache the blocks?pread
- use pread (for concurrent small readers)isCompaction
- is scanner being used for compaction?public void close(boolean evictOnClose) throws IOException
IOException
boolean passesTimerangeFilter(TimeRange tr, long oldestUnexpiredTS)
tr
- the timeRange to restrictoldestUnexpiredTS
- the oldest timestamp that is not expired, as
determined by the column family's TTLboolean passesBloomFilter(Scan scan, SortedSet<byte[]> columns)
StoreFileScanner.seek(Cell)
and uses
the lower-level API passesGeneralRowBloomFilter(byte[], int, int)
and passesGeneralRowColBloomFilter(Cell)
.scan
- the scan specification. Used to determine the row, and to
check whether this is a single-row ("get") scan.columns
- the set of columns. Only used for row-column Bloom
filters.public boolean passesDeleteFamilyBloomFilter(byte[] row, int rowOffset, int rowLen)
private boolean passesGeneralRowBloomFilter(byte[] row, int rowOffset, int rowLen)
public boolean passesGeneralRowColBloomFilter(Cell cell)
cell
- the cell to check if present in BloomFilterprivate boolean passesGeneralRowPrefixBloomFilter(Scan scan)
private boolean checkGeneralBloomFilter(byte[] key, Cell kvKey, BloomFilter bloomFilter)
public boolean passesKeyRangeFilter(Scan scan)
scan
- the scan specification. Used to determine the rowkey range.public Map<byte[],byte[]> loadFileInfo() throws IOException
IOException
public void loadBloomfilter()
public void loadBloomfilter(BlockType blockType)
private void setBloomFilterFaulty(BlockType blockType)
public long getFilterEntries()
public void setGeneralBloomFilterFaulty()
public void setDeleteFamilyBloomFilterFaulty()
public Optional<Cell> getLastKey()
public Optional<byte[]> getLastRowKey()
public Optional<Cell> midKey() throws IOException
IOException
public long length()
public long getTotalUncompressedBytes()
public long getEntries()
public long getDeleteFamilyCnt()
public Optional<Cell> getFirstKey()
public long indexSize()
public BloomType getBloomFilterType()
public long getSequenceID()
public void setSequenceID(long sequenceID)
public void setBulkLoaded(boolean bulkLoadResult)
public boolean isBulkLoaded()
BloomFilter getGeneralBloomFilter()
long getUncompressedDataIndexSize()
public long getTotalBloomSize()
public int getHFileVersion()
public int getHFileMinorVersion()
public HFile.Reader getHFileReader()
void disableBloomFilterForTesting()
public long getMaxTimestamp()
boolean isSkipResetSeqId()
void setSkipResetSeqId(boolean skipResetSeqId)
public int getPrefixLength()
public ReaderContext getReaderContext()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.