Class BloomFilterChunk

java.lang.Object
org.apache.hadoop.hbase.util.BloomFilterChunk
All Implemented Interfaces:
BloomFilterBase

@Private public class BloomFilterChunk extends Object implements BloomFilterBase
The basic building block for the CompoundBloomFilter
  • Field Details

    • byteSize

      protected long byteSize
      Bytes (B) in the array. This actually has to fit into an int.
    • hashCount

      protected int hashCount
      Number of hash functions
    • hashType

      protected final int hashType
      Hash type
    • hash

      protected final Hash hash
      Hash Function
    • keyCount

      protected int keyCount
      Keys currently in the bloom
    • maxKeys

      protected int maxKeys
      Max Keys expected for the bloom
    • bloom

      protected ByteBuffer bloom
      Bloom bits
    • bloomType

      protected BloomType bloomType
      The type of bloom
  • Constructor Details

    • BloomFilterChunk

      Loads bloom filter meta data from file input.
      Parameters:
      meta - stored bloom meta data
      Throws:
      IllegalArgumentException - meta data is invalid
      IOException
    • BloomFilterChunk

      public BloomFilterChunk(int hashType, BloomType bloomType)
    • BloomFilterChunk

      public BloomFilterChunk(int maxKeys, double errorRate, int hashType, int foldFactor) throws IllegalArgumentException
      Determines & initializes bloom filter meta data from user config. Call allocBloom() to allocate bloom filter data.
      Parameters:
      maxKeys - Maximum expected number of keys that will be stored in this bloom
      errorRate - Desired false positive error rate. Lower rate = more storage required
      hashType - Type of hash function to use
      foldFactor - When finished adding entries, you may be able to 'fold' this bloom to save space. Tradeoff potentially excess bytes in bloom for ability to fold if keyCount is exponentially greater than maxKeys.
      Throws:
      IllegalArgumentException
  • Method Details