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
Modifier and TypeFieldDescriptionprivate static final int[]
private org.apache.hadoop.hbase.io.hfile.BlockCache
private 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.CacheConfig
static final HBaseClassTestRule
private static org.apache.hadoop.conf.Configuration
private static final int
private org.apache.hadoop.fs.FileSystem
private static final int
private static final org.slf4j.Logger
private static final int[]
private static final int
private static final double[]
private static final HBaseTestingUtil
private String
A message of the form "in test#<number>:" to include in logging.private static final double
A false positive rate that is obviously too high. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate List<org.apache.hadoop.hbase.KeyValue>
createSortedKeyValues
(Random rand, int n) private boolean
isInBloom
(org.apache.hadoop.hbase.regionserver.StoreFileScanner scanner, byte[] row, byte[] qualifier) private boolean
isInBloom
(org.apache.hadoop.hbase.regionserver.StoreFileScanner scanner, byte[] row, org.apache.hadoop.hbase.regionserver.BloomType bt, Random rand) 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) void
setUp()
void
void
void
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.private org.apache.hadoop.fs.Path
writeStoreFile
(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
-