Interface RBloomFilterRx<T>

Type Parameters:
T - - type of object
All Superinterfaces:
RExpirableRx, RObjectRx

public interface RBloomFilterRx<T> extends RExpirableRx
Distributed implementation of Bloom filter based on Highway 128-bit hash.
Author:
Nikita Koksharov
  • Method Details

    • add

      io.reactivex.rxjava3.core.Single<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
    • add

      io.reactivex.rxjava3.core.Single<Long> add(Collection<T> elements)
      Adds elements
      Parameters:
      elements - elements to add
      Returns:
      number of added elements
    • contains

      io.reactivex.rxjava3.core.Single<Boolean> contains(T object)
      Checks for element presence
      Parameters:
      object - element
      Returns:
      true if element is present false if element is not present
    • contains

      io.reactivex.rxjava3.core.Single<Long> contains(Collection<T> elements)
      Checks for elements presence
      Parameters:
      elements - elements to check presence
      Returns:
      number of elements present
    • tryInit

      io.reactivex.rxjava3.core.Single<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

      io.reactivex.rxjava3.core.Single<Long> getExpectedInsertions()
      Returns expected amount of insertions per element. Calculated during bloom filter initialization.
      Returns:
      expected amount of insertions per element
    • getFalseProbability

      io.reactivex.rxjava3.core.Single<Double> getFalseProbability()
      Returns false probability of element presence. Calculated during bloom filter initialization.
      Returns:
      false probability of element presence
    • getSize

      io.reactivex.rxjava3.core.Single<Long> getSize()
      Returns number of bits in Redis memory required by this instance
      Returns:
      number of bits
    • getHashIterations

      io.reactivex.rxjava3.core.Single<Integer> getHashIterations()
      Returns hash iterations amount used per element. Calculated during bloom filter initialization.
      Returns:
      hash iterations amount
    • count

      io.reactivex.rxjava3.core.Single<Long> count()
      Calculates probabilistic number of elements already added to Bloom filter.
      Returns:
      probabilistic number of elements