Package org.apache.hadoop.hbase.io.hfile
Class CompoundBloomFilter
java.lang.Object
org.apache.hadoop.hbase.io.hfile.CompoundBloomFilterBase
org.apache.hadoop.hbase.io.hfile.CompoundBloomFilter
- All Implemented Interfaces:
BloomFilter,BloomFilterBase
A Bloom filter implementation built on top of
BloomFilterChunk, encapsulating a set of fixed-size Bloom
filters written out at the time of HFile generation into
the data block stream, and loaded on demand at query time. This class only provides reading
capabilities.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Hashprivate intprivate HFileBlockIndex.BlockIndexReaderprivate final BloomFilterMetricsprivate long[]private long[]private HFile.ReaderUsed to load chunks on demandFields inherited from class org.apache.hadoop.hbase.io.hfile.CompoundBloomFilterBase
comparator, errorRate, hashType, numChunks, totalByteSize, totalKeyCount, totalMaxKeys, VERSION -
Constructor Summary
ConstructorsConstructorDescriptionCompoundBloomFilter(DataInput meta, HFile.Reader reader, BloomFilterMetrics metrics) De-serialization for compound Bloom filter metadata. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if the specified key is contained in the bloom filter.booleanCheck if the specified key is contained in the bloom filter.private booleancontainsInternal(byte[] key, int keyOffset, int keyLength, ByteBuff bloom) private booleancontainsInternal(Cell keyCell, ByteBuff bloom, BloomType type) voidgetBloomBlock(int block) getHash()intintlonggetNumPositivesForTesting(int chunk) longgetNumQueriesForTesting(int chunk) booleantoString()Methods inherited from class org.apache.hadoop.hbase.io.hfile.CompoundBloomFilterBase
getByteSize, getKeyCount, getMaxKeysMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.util.BloomFilterBase
getByteSize, getKeyCount, getMaxKeys
-
Field Details
-
reader
Used to load chunks on demand -
metrics
-
index
-
hashCount
-
hash
-
numQueriesPerChunk
-
numPositivesPerChunk
-
-
Constructor Details
-
CompoundBloomFilter
public CompoundBloomFilter(DataInput meta, HFile.Reader reader, BloomFilterMetrics metrics) throws IOException De-serialization for compound Bloom filter metadata. Must be consistent with whatCompoundBloomFilterWriterdoes.- Parameters:
meta- serialized Bloom filter metadata without any magic blocksreader- reader for hfilemetrics- for collecting bloom filter metrics. may be null- Throws:
IOException
-
-
Method Details
-
contains
Description copied from interface:BloomFilterCheck if the specified key is contained in the bloom filter.- Specified by:
containsin interfaceBloomFilter- Parameters:
key- data to check for existence ofkeyOffset- offset into the datakeyLength- length of the databloom- bloom filter data to search. This can be null if auto-loading is supported.- Returns:
- true if matched by bloom, false if not
-
containsInternal
-
getBloomBlock
-
contains
Description copied from interface:BloomFilterCheck if the specified key is contained in the bloom filter.- Specified by:
containsin interfaceBloomFilter- Parameters:
keyCell- the key to check for the existence ofbloom- bloom filter data to search. This can be null if auto-loading is supported.type- The type of Bloom ROW/ ROW_COL- Returns:
- true if matched by bloom, false if not
-
containsInternal
-
supportsAutoLoading
- Specified by:
supportsAutoLoadingin interfaceBloomFilter- Returns:
- true if this Bloom filter can automatically load its data and thus allows a null byte buffer to be passed to contains()
-
getNumChunks
-
enableTestingStats
-
formatTestingStats
-
getNumQueriesForTesting
-
getNumPositivesForTesting
-
toString
-
getBloomIndex
-
getHashCount
-
getHash
-