Interface CuckooFilterCommands

All Known Subinterfaces:
RedisBloomCommands, RedisModuleCommands
All Known Implementing Classes:
JedisCluster, JedisPooled, JedisSentineled, JedisSharding, UnifiedJedis

public interface CuckooFilterCommands
Interface for RedisBloom Cuckoo Filter Commands
See Also:
  • Method Details

    • cfReserve

      String cfReserve(String key, long capacity)
      CF.RESERVE Creates a Cuckoo Filter under key with the given parameters
      Parameters:
      key - The name of the filter
      capacity -
      Returns:
      OK
    • cfReserve

      String cfReserve(String key, long capacity, CFReserveParams reserveParams)
      CF.RESERVE Creates a Cuckoo Filter under key with the given parameters
      Parameters:
      key - The name of the filter
      capacity -
      reserveParams - An instance of CFReserveParams containing the options
      Returns:
      OK
    • cfAdd

      boolean cfAdd(String key, String item)
      CF.ADD Adds an item to the cuckoo filter, creating the filter if it does not exist
      Parameters:
      key - The name of the filter
      item - The item to add
      Returns:
      true on success, false otherwise
    • cfAddNx

      boolean cfAddNx(String key, String item)
      CF.ADDNX Adds an item to the cuckoo filter, only if it does not exist yet
      Parameters:
      key - The name of the filter
      item - The item to add
      Returns:
      true if the item was added to the filter, false if the item already exists.
    • cfInsert

      List<Boolean> cfInsert(String key, String... items)
      CF.INSERT Adds one or more items to a cuckoo filter, creating it if it does not exist yet.
      Parameters:
      key - The name of the filter
      items - One or more items to add
      Returns:
      true if the item was successfully inserted, false if an error occurred
    • cfInsert

      List<Boolean> cfInsert(String key, CFInsertParams insertParams, String... items)
      CF.INSERT Adds one or more items to a cuckoo filter, using the passed options
      Parameters:
      key - The name of the filter
      insertParams - An instance of CFInsertParams containing the options
      items - One or more items to add
      Returns:
      true if the item was successfully inserted, false if an error occurred
    • cfInsertNx

      List<Boolean> cfInsertNx(String key, String... items)
      CF.INSERTNX Adds one or more items to a cuckoo filter, only if it does not exist yet
      Parameters:
      key - The name of the filter
      items - One or more items to add
      Returns:
      true if the item was added to the filter, false if the item already exists.
    • cfInsertNx

      List<Boolean> cfInsertNx(String key, CFInsertParams insertParams, String... items)
      CF.INSERTNX Adds one or more items to a cuckoo filter, using the passed options
      Parameters:
      key - The name of the filter
      insertParams - An instance of CFInsertParams containing the options (CAPACITY/NOCREATE)
      items - One or more items to add
      Returns:
      true if the item was added to the filter, false if the item already exists.
    • cfExists

      boolean cfExists(String key, String item)
      CF.EXISTS Check if an item exists in a Cuckoo Filter
      Parameters:
      key - The name of the filter
      item - The item to check for
      Returns:
      false if the item certainly does not exist, true if the item may exist.
    • cfMExists

      List<Boolean> cfMExists(String key, String... items)
      CF.MEXISTS {key} {item ...}
      Parameters:
      key - The name of the filter
      items - Items to check for (non empty sequence)
      Returns:
      a list of booleans where false if the item certainly does not exist, true if the item may exist.
    • cfDel

      boolean cfDel(String key, String item)
      CF.DEL Deletes an item once from the filter. If the item exists only once, it will be removed from the filter. If the item was added multiple times, it will still be present.
      Parameters:
      key - The name of the filter
      item - The item to delete from the filter
      Returns:
      true if the item has been deleted, false if the item was not found.
    • cfCount

      long cfCount(String key, String item)
      CF.COUNT Returns the number of times an item may be in the filter.
      Parameters:
      key - The name of the filter
      item - The item to count
      Returns:
      The number of times the item exists in the filter
    • cfScanDump

      Map.Entry<Long,byte[]> cfScanDump(String key, long iterator)
      CF.SCANDUMP Begins an incremental save of the cuckoo filter. This is useful for large cuckoo filters which cannot fit into the normal SAVE and RESTORE model. The Iterator is passed as input to the next invocation of SCANDUMP . If Iterator is 0, the iteration has completed.
      Parameters:
      key - Name of the filter
      iterator - This is either 0, or the iterator from a previous invocation of this command
      Returns:
      a Map.Entry containing the Iterator and Data.
    • cfLoadChunk

      String cfLoadChunk(String key, long iterator, byte[] data)
      CF.LOADCHUNK Restores a filter previously saved using SCANDUMP.
      Parameters:
      key - Name of the filter to restore
      iterator - Iterator from CF.SCANDUMP
      data - Data from CF.SCANDUMP
      Returns:
      OK
    • cfInfo

      Map<String,Object> cfInfo(String key)
      CF.INFO Return information about filter
      Parameters:
      key - Name of the filter to restore
      Returns:
      A Map containing Size, Number of buckets, Number of filter, Number of items inserted, Number of items deleted, Bucket size, Expansion rate, Max iteration