public class TestCompoundBloomFilter extends Object
Modifier and Type | Field and Description |
---|---|
private static int[] |
BLOCK_SIZES |
private org.apache.hadoop.hbase.io.hfile.BlockCache |
blockCache |
private static int[] |
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.
|
private static org.apache.hadoop.hbase.regionserver.BloomType[] |
BLOOM_TYPES |
private static org.apache.hadoop.hbase.io.hfile.CacheConfig |
cacheConf |
static HBaseClassTestRule |
CLASS_RULE |
private static org.apache.hadoop.conf.Configuration |
conf |
private static int |
EVALUATION_SEED |
private org.apache.hadoop.fs.FileSystem |
fs |
private static int |
GENERATION_SEED |
private static org.slf4j.Logger |
LOG |
private static int[] |
NUM_KV |
private static int |
NUM_TESTS |
private static double[] |
TARGET_ERROR_RATES |
private static HBaseTestingUtility |
TEST_UTIL |
private String |
testIdMsg
A message of the form "in test#<number>:" to include in logging.
|
private static double |
TOO_HIGH_ERROR_RATE
A false positive rate that is obviously too high.
|
Constructor and Description |
---|
TestCompoundBloomFilter() |
Modifier and Type | Method and Description |
---|---|
private List<org.apache.hadoop.hbase.KeyValue> |
createSortedKeyValues(Random rand,
int n) |
private boolean |
isInBloom(org.apache.hadoop.hbase.regionserver.StoreFileScanner scanner,
byte[] row,
org.apache.hadoop.hbase.regionserver.BloomType bt,
Random rand) |
private boolean |
isInBloom(org.apache.hadoop.hbase.regionserver.StoreFileScanner scanner,
byte[] row,
byte[] qualifier) |
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 |
testCompoundBloomFilter() |
void |
testCompoundBloomSizing() |
void |
testCreateKey() |
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) |
public static final HBaseClassTestRule CLASS_RULE
private static final HBaseTestingUtility TEST_UTIL
private static final org.slf4j.Logger LOG
private static final int NUM_TESTS
private static final org.apache.hadoop.hbase.regionserver.BloomType[] BLOOM_TYPES
private static final int[] NUM_KV
private static final int[] BLOCK_SIZES
private static final int[] BLOOM_BLOCK_SIZES
private static final double[] TARGET_ERROR_RATES
private static final double TOO_HIGH_ERROR_RATE
private static org.apache.hadoop.conf.Configuration conf
private static org.apache.hadoop.hbase.io.hfile.CacheConfig cacheConf
private org.apache.hadoop.fs.FileSystem fs
private static final int GENERATION_SEED
private static final int EVALUATION_SEED
private org.apache.hadoop.hbase.io.hfile.BlockCache blockCache
public TestCompoundBloomFilter()
public void setUp() throws IOException
IOException
private List<org.apache.hadoop.hbase.KeyValue> createSortedKeyValues(Random rand, int n)
public void testCompoundBloomFilter() throws IOException
IOException
private void validateFalsePosRate(double falsePosRate, int nTrials, double zValueBoundary, org.apache.hadoop.hbase.io.hfile.CompoundBloomFilter cbf, String additionalMsg)
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 failuresprivate 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
IOException
private boolean isInBloom(org.apache.hadoop.hbase.regionserver.StoreFileScanner scanner, byte[] row, org.apache.hadoop.hbase.regionserver.BloomType bt, Random rand)
private boolean isInBloom(org.apache.hadoop.hbase.regionserver.StoreFileScanner scanner, byte[] row, byte[] qualifier)
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
IOException
public void testCompoundBloomSizing()
public void testCreateKey()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.