org.apache.hadoop.hbase.util
Class CompoundBloomFilterBase

java.lang.Object
  extended by org.apache.hadoop.hbase.util.CompoundBloomFilterBase
All Implemented Interfaces:
BloomFilterBase
Direct Known Subclasses:
CompoundBloomFilter, CompoundBloomFilterWriter

@InterfaceAudience.Private
public class CompoundBloomFilterBase
extends Object
implements BloomFilterBase


Field Summary
protected  KeyValue.KVComparator comparator
          Comparator used to compare Bloom filter keys
protected  float errorRate
          Target error rate for configuring the filter and for information
protected  int hashType
          Hash function type to use, as defined in Hash
protected  int numChunks
          At read time, the total number of chunks.
protected  long totalByteSize
           
protected  long totalKeyCount
          The total number of keys in all chunks
protected  long totalMaxKeys
           
static int VERSION
          The Bloom filter version.
 
Constructor Summary
CompoundBloomFilterBase()
           
 
Method Summary
 byte[] createBloomKey(byte[] row, int roffset, int rlength, byte[] qualifier, int qoffset, int qlength)
          Prepare an ordered pair of row and qualifier to be compared using KeyValue.KeyComparator.
 long getByteSize()
           
 KeyValue.KVComparator getComparator()
           
 long getKeyCount()
           
 long getMaxKeys()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numChunks

protected int numChunks
At read time, the total number of chunks. At write time, the number of chunks created so far. The first chunk has an ID of 0, and the current chunk has the ID of numChunks - 1.


VERSION

public static final int VERSION
The Bloom filter version. There used to be a DynamicByteBloomFilter which had version 2.

See Also:
Constant Field Values

errorRate

protected float errorRate
Target error rate for configuring the filter and for information


totalKeyCount

protected long totalKeyCount
The total number of keys in all chunks


totalByteSize

protected long totalByteSize

totalMaxKeys

protected long totalMaxKeys

hashType

protected int hashType
Hash function type to use, as defined in Hash


comparator

protected KeyValue.KVComparator comparator
Comparator used to compare Bloom filter keys

Constructor Detail

CompoundBloomFilterBase

public CompoundBloomFilterBase()
Method Detail

getMaxKeys

public long getMaxKeys()
Specified by:
getMaxKeys in interface BloomFilterBase
Returns:
The max number of keys that can be inserted to maintain the desired error rate

getKeyCount

public long getKeyCount()
Specified by:
getKeyCount in interface BloomFilterBase
Returns:
The number of keys added to the bloom

getByteSize

public long getByteSize()
Specified by:
getByteSize in interface BloomFilterBase
Returns:
Size of the bloom, in bytes

createBloomKey

public byte[] createBloomKey(byte[] row,
                             int roffset,
                             int rlength,
                             byte[] qualifier,
                             int qoffset,
                             int qlength)
Prepare an ordered pair of row and qualifier to be compared using KeyValue.KeyComparator. This is only used for row-column Bloom filters.

Specified by:
createBloomKey in interface BloomFilterBase

getComparator

public KeyValue.KVComparator getComparator()
Specified by:
getComparator in interface BloomFilterBase
Returns:
Bloom key comparator


Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.