@InterfaceAudience.LimitedPrivate(value="Phoenix") @InterfaceStability.Evolving public class StoreFileReader extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
StoreFileReader.Listener |
Modifier and Type | Field and Description |
---|---|
protected BloomType |
bloomFilterType |
private boolean |
bulkLoadResult |
private boolean |
closed |
protected BloomFilter |
deleteFamilyBloomFilter |
private long |
deleteFamilyCnt |
protected BloomFilter |
generalBloomFilter |
private byte[] |
lastBloomKey |
private KeyValue.KeyOnlyKeyValue |
lastBloomKeyOnlyKV |
private StoreFileReader.Listener |
listener |
private static org.slf4j.Logger |
LOG |
private HFile.Reader |
reader |
private AtomicInteger |
refCount |
protected long |
sequenceID |
(package private) boolean |
shared |
private boolean |
skipResetSeqId |
protected TimeRange |
timeRange |
Modifier | Constructor and Description |
---|---|
(package private) |
StoreFileReader()
ONLY USE DEFAULT CONSTRUCTOR FOR UNIT TESTS
|
|
StoreFileReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
CacheConfig cacheConf,
boolean primaryReplicaStoreFile,
AtomicInteger refCount,
boolean shared,
org.apache.hadoop.conf.Configuration conf) |
|
StoreFileReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
FSDataInputStreamWrapper in,
long size,
CacheConfig cacheConf,
boolean primaryReplicaStoreFile,
AtomicInteger refCount,
boolean shared,
org.apache.hadoop.conf.Configuration conf) |
private |
StoreFileReader(HFile.Reader reader,
AtomicInteger refCount,
boolean shared) |
Modifier and Type | Method and Description |
---|---|
private boolean |
checkGeneralBloomFilter(byte[] key,
Cell kvKey,
BloomFilter bloomFilter) |
void |
close(boolean evictOnClose) |
(package private) void |
copyFields(StoreFileReader reader) |
(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() |
(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) |
boolean |
passesGeneralRowBloomFilter(byte[] row,
int rowOffset,
int rowLen)
A method for checking Bloom filters.
|
boolean |
passesGeneralRowColBloomFilter(Cell cell)
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 |
setListener(StoreFileReader.Listener listener) |
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 final AtomicInteger refCount
final boolean shared
private volatile StoreFileReader.Listener listener
private boolean closed
private StoreFileReader(HFile.Reader reader, AtomicInteger refCount, boolean shared)
public StoreFileReader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, CacheConfig cacheConf, boolean primaryReplicaStoreFile, AtomicInteger refCount, boolean shared, org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
public StoreFileReader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, FSDataInputStreamWrapper in, long size, CacheConfig cacheConf, boolean primaryReplicaStoreFile, AtomicInteger refCount, boolean shared, org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
StoreFileReader()
void copyFields(StoreFileReader reader)
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)
timeRange
- 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)
public boolean passesGeneralRowBloomFilter(byte[] row, int rowOffset, int rowLen)
public boolean passesGeneralRowColBloomFilter(Cell cell)
cell
- the cell to check if present in BloomFilterprivate 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 void setListener(StoreFileReader.Listener listener)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.