@InterfaceAudience.Private public final class BloomFilterFactory extends Object
HStoreFile
.Modifier and Type | Field and Description |
---|---|
static String |
IO_STOREFILE_BLOOM_BLOCK_SIZE
Target Bloom block size.
|
static String |
IO_STOREFILE_BLOOM_ENABLED
Master switch to enable Bloom filters
|
static String |
IO_STOREFILE_BLOOM_ERROR_RATE
Specifies the target error rate to use when selecting the number of keys
per Bloom filter.
|
static String |
IO_STOREFILE_BLOOM_MAX_FOLD
Maximum folding factor allowed.
|
static String |
IO_STOREFILE_BLOOM_MAX_KEYS
For default (single-block) Bloom filters this specifies the maximum number
of keys.
|
static String |
IO_STOREFILE_DELETEFAMILY_BLOOM_ENABLED
Master switch to enable Delete Family Bloom filters
|
private static org.slf4j.Logger |
LOG |
private static int |
MAX_ALLOWED_FOLD_FACTOR
Maximum number of times a Bloom filter can be "folded" if oversized
|
Modifier | Constructor and Description |
---|---|
private |
BloomFilterFactory()
This class should not be instantiated.
|
Modifier and Type | Method and Description |
---|---|
static BloomFilterWriter |
createDeleteBloomAtWrite(org.apache.hadoop.conf.Configuration conf,
CacheConfig cacheConf,
int maxKeys,
HFile.Writer writer)
Creates a new Delete Family Bloom filter at the time of
HStoreFile writing. |
static BloomFilter |
createFromMeta(DataInput meta,
HFile.Reader reader)
Instantiates the correct Bloom filter class based on the version provided
in the meta block data.
|
static BloomFilterWriter |
createGeneralBloomAtWrite(org.apache.hadoop.conf.Configuration conf,
CacheConfig cacheConf,
BloomType bloomType,
int maxKeys,
HFile.Writer writer)
Creates a new general (Row or RowCol) Bloom filter at the time of
HStoreFile writing. |
static int |
getBloomBlockSize(org.apache.hadoop.conf.Configuration conf) |
static float |
getErrorRate(org.apache.hadoop.conf.Configuration conf) |
static int |
getMaxFold(org.apache.hadoop.conf.Configuration conf) |
static int |
getMaxKeys(org.apache.hadoop.conf.Configuration conf) |
static boolean |
isDeleteFamilyBloomEnabled(org.apache.hadoop.conf.Configuration conf) |
static boolean |
isGeneralBloomEnabled(org.apache.hadoop.conf.Configuration conf) |
private static final org.slf4j.Logger LOG
public static final String IO_STOREFILE_BLOOM_ERROR_RATE
public static final String IO_STOREFILE_BLOOM_MAX_FOLD
public static final String IO_STOREFILE_BLOOM_MAX_KEYS
public static final String IO_STOREFILE_BLOOM_ENABLED
public static final String IO_STOREFILE_DELETEFAMILY_BLOOM_ENABLED
public static final String IO_STOREFILE_BLOOM_BLOCK_SIZE
private static final int MAX_ALLOWED_FOLD_FACTOR
private BloomFilterFactory()
public static BloomFilter createFromMeta(DataInput meta, HFile.Reader reader) throws IllegalArgumentException, IOException
meta
- the byte array holding the Bloom filter's metadata, including
version informationreader
- the HFile
reader to use to lazily load Bloom filter
blocksIllegalArgumentException
IOException
public static boolean isGeneralBloomEnabled(org.apache.hadoop.conf.Configuration conf)
public static boolean isDeleteFamilyBloomEnabled(org.apache.hadoop.conf.Configuration conf)
public static float getErrorRate(org.apache.hadoop.conf.Configuration conf)
public static int getMaxFold(org.apache.hadoop.conf.Configuration conf)
public static int getBloomBlockSize(org.apache.hadoop.conf.Configuration conf)
public static int getMaxKeys(org.apache.hadoop.conf.Configuration conf)
public static BloomFilterWriter createGeneralBloomAtWrite(org.apache.hadoop.conf.Configuration conf, CacheConfig cacheConf, BloomType bloomType, int maxKeys, HFile.Writer writer)
HStoreFile
writing.conf
- cacheConf
- bloomType
- maxKeys
- an estimate of the number of keys we expect to insert.
Irrelevant if compound Bloom filters are enabled.writer
- the HFile writerpublic static BloomFilterWriter createDeleteBloomAtWrite(org.apache.hadoop.conf.Configuration conf, CacheConfig cacheConf, int maxKeys, HFile.Writer writer)
HStoreFile
writing.conf
- cacheConf
- maxKeys
- an estimate of the number of keys we expect to insert.
Irrelevant if compound Bloom filters are enabled.writer
- the HFile writerCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.