Class SlidingCuckooFilter

java.lang.Object
jadex.requiredservice.impl.SlidingCuckooFilter

public class SlidingCuckooFilter extends Object
Filter class based on two cuckoo filter. Splits the capacity into two filters, if the capacity is exceeded, the older filter is dropped and a new filter is created.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
    The bucket size / entries per bucker.
    protected net.cinnom.nanocuckoo.NanoCuckooFilter
    The current filter.
    protected net.cinnom.nanocuckoo.NanoCuckooFilter
    The currently expiring filter.
    protected byte
    Size of fingerprints in bits.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the cuckoo filter with the given capacity and a false positive probability of ~1:500000.
    SlidingCuckooFilter(long capacity, int bucketsize, byte fingerprintsize)
    Creates the cuckoo filter with the given capacity and false positive probability.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(String string)
    Check if a given byte array is contained in the filter.
    protected net.cinnom.nanocuckoo.NanoCuckooFilter
    createFilter(long capacity)
    Creates a new filter.
    void
    Delete a value from the filter.
    void
    insert(String string)
    Insert a byte array into the filter.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • expiringfilter

      protected net.cinnom.nanocuckoo.NanoCuckooFilter expiringfilter
      The currently expiring filter.
    • currentfilter

      protected net.cinnom.nanocuckoo.NanoCuckooFilter currentfilter
      The current filter.
    • bucketsize

      protected int bucketsize
      The bucket size / entries per bucker.
    • fingerprintsize

      protected byte fingerprintsize
      Size of fingerprints in bits.
  • Constructor Details

    • SlidingCuckooFilter

      public SlidingCuckooFilter()
      Creates the cuckoo filter with the given capacity and a false positive probability of ~1:500000.
      Parameters:
      capacity - Capacity.
    • SlidingCuckooFilter

      public SlidingCuckooFilter(long capacity, int bucketsize, byte fingerprintsize)
      Creates the cuckoo filter with the given capacity and false positive probability.
      Parameters:
      capacity - Filter capacity of a single filter.
      bucketsize - Size of buckets.
      fingerprintsize - Size of fingerprints.
  • Method Details

    • insert

      public void insert(String string)
      Insert a byte array into the filter.
      Parameters:
      string - The data being inserted.
    • delete

      public void delete(String val)
      Delete a value from the filter.
      Parameters:
      val - The value to delete.
    • contains

      public boolean contains(String string)
      Check if a given byte array is contained in the filter.
      Parameters:
      data - The data being checked.
      Returns:
      True if value is probably contained.
    • createFilter

      protected net.cinnom.nanocuckoo.NanoCuckooFilter createFilter(long capacity)
      Creates a new filter.
      Parameters:
      capacity - Filter capacity.
      bucketsize - Size of buckets
      fingerprintsize - Size of fingerprints.
      Returns:
      The filter.