Interface RBloomFilter<T>

    • Method Detail

      • add

        boolean add(T object)
        Adds element
        Parameters:
        object - - element to add
        Returns:
        true if element has been added successfully false if element is already present
      • contains

        boolean contains(T object)
        Check for element present
        Parameters:
        object - - element
        Returns:
        true if element is present false if element is not present
      • tryInit

        boolean tryInit(long expectedInsertions,
                        double falseProbability)
        Initializes Bloom filter params (size and hashIterations) calculated from expectedInsertions and falseProbability Stores config to Redis server.
        Parameters:
        expectedInsertions - - expected amount of insertions per element
        falseProbability - - expected false probability
        Returns:
        true if Bloom filter initialized false if Bloom filter already has been initialized
      • getExpectedInsertions

        long getExpectedInsertions()
        Returns expected amount of insertions per element. Calculated during bloom filter initialization.
        Returns:
        expected amount of insertions per element
      • getFalseProbability

        double getFalseProbability()
        Returns false probability of element presence. Calculated during bloom filter initialization.
        Returns:
        false probability of element presence
      • getSize

        long getSize()
        Returns number of bits in Redis memory required by this instance
        Returns:
        number of bits
      • getHashIterations

        int getHashIterations()
        Returns hash iterations amount used per element. Calculated during bloom filter initialization.
        Returns:
        hash iterations amount
      • count

        long count()
        Calculates probabilistic number of elements already added to Bloom filter.
        Returns:
        probabilistic number of elements