public static class StoreFile.Reader extends Object
Modifier and Type | Field and Description |
---|---|
protected BloomType |
bloomFilterType |
private boolean |
bulkLoadResult |
protected BloomFilter |
deleteFamilyBloomFilter |
private long |
deleteFamilyCnt |
protected BloomFilter |
generalBloomFilter |
private byte[] |
lastBloomKey |
private static org.apache.commons.logging.Log |
LOG |
private HFile.Reader |
reader |
protected long |
sequenceID |
protected TimeRangeTracker |
timeRangeTracker |
Constructor and Description |
---|
StoreFile.Reader()
ONLY USE DEFAULT CONSTRUCTOR FOR UNIT TESTS
|
StoreFile.Reader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
CacheConfig cacheConf,
org.apache.hadoop.conf.Configuration conf) |
StoreFile.Reader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
FSDataInputStreamWrapper in,
long size,
CacheConfig cacheConf,
org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
void |
close(boolean evictOnClose) |
(package private) void |
disableBloomFilterForTesting() |
BloomType |
getBloomFilterType() |
KeyValue.KVComparator |
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.
|
byte[] |
getFirstKey() |
(package private) BloomFilter |
getGeneralBloomFilter() |
int |
getHFileMinorVersion() |
HFile.Reader |
getHFileReader() |
int |
getHFileVersion() |
byte[] |
getLastKey() |
byte[] |
getLastRowKey() |
long |
getMaxTimestamp() |
HFileScanner |
getScanner(boolean cacheBlocks,
boolean pread)
Deprecated.
|
HFileScanner |
getScanner(boolean cacheBlocks,
boolean pread,
boolean isCompaction)
Deprecated.
|
long |
getSequenceID() |
StoreFileScanner |
getStoreFileScanner(boolean cacheBlocks,
boolean pread)
Get a scanner to scan over this StoreFile.
|
StoreFileScanner |
getStoreFileScanner(boolean cacheBlocks,
boolean pread,
boolean isCompaction,
long readPt)
Get a scanner to scan over this StoreFile.
|
long |
getTotalBloomSize() |
long |
getTotalUncompressedBytes() |
(package private) long |
getUncompressedDataIndexSize() |
long |
indexSize() |
boolean |
isBulkLoaded() |
boolean |
isPrimaryReplicaReader() |
long |
length() |
void |
loadBloomfilter() |
private void |
loadBloomfilter(BlockType blockType) |
Map<byte[],byte[]> |
loadFileInfo() |
byte[] |
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 |
passesGeneralBloomFilter(byte[] row,
int rowOffset,
int rowLen,
byte[] col,
int colOffset,
int colLen)
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 timeRange,
long oldestUnexpiredTS)
Check if this storeFile may contain keys within the TimeRange that
have not expired (i.e.
|
private void |
setBloomFilterFaulty(BlockType blockType) |
void |
setBulkLoaded(boolean bulkLoadResult) |
void |
setDeleteFamilyBloomFilterFaulty() |
void |
setGeneralBloomFilterFaulty() |
void |
setReplicaStoreFile(boolean isPrimaryReplicaStoreFile) |
void |
setSequenceID(long sequenceID) |
private static final org.apache.commons.logging.Log LOG
protected BloomFilter generalBloomFilter
protected BloomFilter deleteFamilyBloomFilter
protected BloomType bloomFilterType
private final HFile.Reader reader
protected TimeRangeTracker timeRangeTracker
protected long sequenceID
private byte[] lastBloomKey
private long deleteFamilyCnt
private boolean bulkLoadResult
public StoreFile.Reader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, CacheConfig cacheConf, org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
public StoreFile.Reader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, FSDataInputStreamWrapper in, long size, CacheConfig cacheConf, org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
StoreFile.Reader()
public void setReplicaStoreFile(boolean isPrimaryReplicaStoreFile)
public boolean isPrimaryReplicaReader()
public KeyValue.KVComparator getComparator()
public StoreFileScanner getStoreFileScanner(boolean cacheBlocks, boolean pread)
cacheBlocks
- should this scanner cache blocks?pread
- use pread (for highly concurrent small readers)public StoreFileScanner getStoreFileScanner(boolean cacheBlocks, boolean pread, boolean isCompaction, long readPt)
cacheBlocks
- should this scanner cache blocks?pread
- use pread (for highly concurrent small readers)isCompaction
- is scanner being used for compaction?@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 timeRange, 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#seekExactly
) and uses
the lower-level API passesGeneralBloomFilter(byte[], int, int, byte[],
int, int)
.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 passesGeneralBloomFilter(byte[] row, int rowOffset, int rowLen, byte[] col, int colOffset, int colLen)
row
- rowOffset
- rowLen
- col
- colOffset
- colLen
- 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()
private void loadBloomfilter(BlockType blockType)
private void setBloomFilterFaulty(BlockType blockType)
public long getFilterEntries()
public void setGeneralBloomFilterFaulty()
public void setDeleteFamilyBloomFilterFaulty()
public byte[] getLastKey()
public byte[] getLastRowKey()
public byte[] midkey() throws IOException
IOException
public long length()
public long getTotalUncompressedBytes()
public long getEntries()
public long getDeleteFamilyCnt()
public byte[] 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()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.