Class TestCompoundBloomFilter
java.lang.Object
org.apache.hadoop.hbase.regionserver.TestCompoundBloomFilter
Tests writing Bloom filter blocks in the same part of the file as data blocks.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int[]private org.apache.hadoop.hbase.io.hfile.BlockCacheprivate static final int[]Be careful not to specify too high a Bloom filter block size, otherwise there will only be one oversized chunk and the observed false positive rate will be too low.private static final org.apache.hadoop.hbase.regionserver.BloomType[]private static org.apache.hadoop.hbase.io.hfile.CacheConfigstatic final HBaseClassTestRuleprivate static org.apache.hadoop.conf.Configurationprivate static final intprivate org.apache.hadoop.fs.FileSystemprivate static final intprivate static final org.slf4j.Loggerprivate static final int[]private static final intprivate static final double[]private static final HBaseTestingUtilprivate StringA message of the form "in test#<number>:" to include in logging.private static final doubleA false positive rate that is obviously too high. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate List<org.apache.hadoop.hbase.KeyValue>createSortedKeyValues(Random rand, int n) private booleanisInBloom(org.apache.hadoop.hbase.regionserver.StoreFileScanner scanner, byte[] row, byte[] qualifier) private booleanisInBloom(org.apache.hadoop.hbase.regionserver.StoreFileScanner scanner, byte[] row, org.apache.hadoop.hbase.regionserver.BloomType bt, Random rand) private voidreadStoreFile(int t, org.apache.hadoop.hbase.regionserver.BloomType bt, List<org.apache.hadoop.hbase.KeyValue> kvs, org.apache.hadoop.fs.Path sfPath) voidsetUp()voidvoidvoidprivate voidvalidateFalsePosRate(double falsePosRate, int nTrials, double zValueBoundary, org.apache.hadoop.hbase.io.hfile.CompoundBloomFilter cbf, String additionalMsg) Validates the false positive ratio by computing its z-value and comparing it to the provided threshold.private org.apache.hadoop.fs.PathwriteStoreFile(int t, org.apache.hadoop.hbase.regionserver.BloomType bt, List<org.apache.hadoop.hbase.KeyValue> kvs)
-
Field Details
-
CLASS_RULE
-
TEST_UTIL
-
LOG
-
NUM_TESTS
- See Also:
-
BLOOM_TYPES
-
NUM_KV
-
BLOCK_SIZES
-
BLOOM_BLOCK_SIZES
Be careful not to specify too high a Bloom filter block size, otherwise there will only be one oversized chunk and the observed false positive rate will be too low. -
TARGET_ERROR_RATES
-
TOO_HIGH_ERROR_RATE
A false positive rate that is obviously too high. -
conf
-
cacheConf
-
fs
-
testIdMsg
A message of the form "in test#<number>:" to include in logging. -
GENERATION_SEED
- See Also:
-
EVALUATION_SEED
- See Also:
-
blockCache
-
-
Constructor Details
-
TestCompoundBloomFilter
public TestCompoundBloomFilter()
-
-
Method Details
-
setUp
- Throws:
IOException
-
createSortedKeyValues
-
testCompoundBloomFilter
- Throws:
IOException
-
validateFalsePosRate
private void validateFalsePosRate(double falsePosRate, int nTrials, double zValueBoundary, org.apache.hadoop.hbase.io.hfile.CompoundBloomFilter cbf, String additionalMsg) Validates the false positive ratio by computing its z-value and comparing it to the provided threshold.- Parameters:
falsePosRate- experimental positive ratenTrials- the number of Bloom filter checkszValueBoundary- z-value boundary, positive for an upper bound and negative for a lower boundcbf- the compound Bloom filter we are usingadditionalMsg- additional message to include in log output and assertion failures
-
readStoreFile
private void readStoreFile(int t, org.apache.hadoop.hbase.regionserver.BloomType bt, List<org.apache.hadoop.hbase.KeyValue> kvs, org.apache.hadoop.fs.Path sfPath) throws IOException - Throws:
IOException
-
isInBloom
-
isInBloom
private boolean isInBloom(org.apache.hadoop.hbase.regionserver.StoreFileScanner scanner, byte[] row, byte[] qualifier) -
writeStoreFile
private org.apache.hadoop.fs.Path writeStoreFile(int t, org.apache.hadoop.hbase.regionserver.BloomType bt, List<org.apache.hadoop.hbase.KeyValue> kvs) throws IOException - Throws:
IOException
-
testCompoundBloomSizing
-
testCreateKey
-