create

public static CuckooFilter<T> create<T>(Funnel<? super T> funnel, long capacity, double fpp)

Creates a filter with the expected number of insertions and expected false positive probability.

Note that overflowing a CuckooFilter with significantly more objects than specified, will result in its saturation causing add to reject new additions.

The constructed CuckooFilter will be serializable if the provided Funnel<T> is.

It is recommended that the funnel be implemented as a Java enum. This has the benefit of ensuring proper serialization and deserialization, which is important since equals also relies on object identity of funnels.

Return

a CuckooFilter

Parameters

funnel

the funnel of T's that the constructed CuckooFilter will use

capacity

the number of expected insertions to the constructed CuckooFilter; must be positive

fpp

the desired false positive probability (must be positive and less than 1.0).


public static CuckooFilter<T> create<T>(Funnel<? super T> funnel, long capacity)

Creates a filter with the expected number of insertions and a default expected false positive probability of 3.2%.

Note that overflowing a CuckooFilter with significantly more objects than specified, will result in its saturation causing add to reject new additions.

The constructed CuckooFilter will be serializable if the provided Funnel<T> is.

It is recommended that the funnel be implemented as a Java enum. This has the benefit of ensuring proper serialization and deserialization, which is important since equals also relies on object identity of funnels.

Return

a CuckooFilter

Parameters

funnel

the funnel of T's that the constructed CuckooFilter will use

capacity

the number of expected insertions to the constructed CuckooFilter; must be positive