Interface BloomOperations<K>

All Known Implementing Classes:
BloomOperationsImpl

public interface BloomOperations<K>
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(K name, String value)
    Adds an item to the filter
    addMulti(K name, String... values)
    Add one or more items to a filter
    void
    createFilter(K name, long initCapacity, double errorRate)
    Reserve a bloom filter.
    boolean
    exists(K name, String value)
    Check if an item exists in the filter
    existsMulti(K name, String... values)
    Check if one or more items exist in the filter
    info(K name)
    Get information about the filter
    insert(K name, redis.clients.jedis.bloom.BFInsertParams options, String... items)
    add one or more items to the bloom filter, by default creating it if it does not yet exist
  • Method Details

    • createFilter

      void createFilter(K name, long initCapacity, double errorRate)
      Reserve a bloom filter.
      Parameters:
      name - The key of the filter
      initCapacity - Optimize for this many items
      errorRate - The desired rate of false positives Note that if a filter is not reserved, a new one is created when is called.
    • add

      boolean add(K name, String value)
      Adds an item to the filter
      Parameters:
      name - The name of the filter
      value - The value to add to the filter
      Returns:
      true if the item was not previously in the filter.
    • insert

      List<Boolean> insert(K name, redis.clients.jedis.bloom.BFInsertParams options, String... items)
      add one or more items to the bloom filter, by default creating it if it does not yet exist
      Parameters:
      name - The name of the filter
      options - BFInsertParams
      items - items to add to the filter
      Returns:
      array of booleans, true for each succesful insertion
    • addMulti

      List<Boolean> addMulti(K name, String... values)
      Add one or more items to a filter
      Parameters:
      name - Name of the filter
      values - values to add to the filter.
      Returns:
      An array of booleans of the same length as the number of values. Each boolean values indicates whether the corresponding element was previously in the filter or not. A true value means the item did not previously exist, whereas a false value means it may have previously existed.
    • exists

      boolean exists(K name, String value)
      Check if an item exists in the filter
      Parameters:
      name - Name (key) of the filter
      value - Value to check for
      Returns:
      true if the item may exist in the filter, false if the item does not exist in the filter
    • existsMulti

      List<Boolean> existsMulti(K name, String... values)
      Check if one or more items exist in the filter
      Parameters:
      name - Name of the filter to check
      values - values to check for
      Returns:
      An array of booleans. A true value means the corresponding value may exist, false means it does not exist
    • info

      Map<String,Object> info(K name)
      Get information about the filter
      Parameters:
      name - the name of the filter
      Returns:
      Return information