public enum CuckooStrategies extends Enum<CuckooStrategies>
Enum Constant and Description |
---|
MURMUR128_BEALDUPRAS_32
Adaptation of "Cuckoo Filter: Practically Better Than Bloom", Bin Fan, et al, that is
comparable to a Bloom Filter's memory efficiency, supports entry deletion, and can accept up to
12.8 billion entries at 3% FPP.
|
Modifier and Type | Method and Description |
---|---|
abstract com.duprasville.guava.probably.CuckooStrategy |
strategy() |
static CuckooStrategies |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CuckooStrategies[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CuckooStrategies MURMUR128_BEALDUPRAS_32
This strategy uses 32 bits of Hashing.murmur3_128(int)
to find an entry's primary index.
The next non-zero f-bit segment of the hash is used as the entry's fingerprint. An entry's
alternate index is defined as [hash(fingerprint) * parsign(index)] modulo bucket_count
,
where hash(fingerprint)
is always odd, and parsign(index)
is defined as +1
when index
is even and -1
when index
is odd. The filter's bucket
count is rounded up to an even number. By specifying an even number of buckets and an odd
fingerprint hash, the parity of the alternate index is guaranteed to be opposite the parity of
the primary index. The use of the index's parity to apply a sign to hash(fingerprint)
causes the operation to be reversible, i.e. index(e) == altIndex(altIndex(e))
.
A notable difference of this strategy from "Cuckoo Filter" is the method of selecting an
entry's alternate index. In the paper, the alternate index is defined as index xor
hash(fingerprint)
. The use of xor
requires that the index space be defined as
[0..2^f]. The side-effect of this is that the Cuckoo Filter's bucket count must be a power of
2, meaning the memory utilization of the filter must be "rounded up" to the next power of two.
This side-effect of the paper's algorithm is avoided by the algorithm as described above.
public static CuckooStrategies[] values()
for (CuckooStrategies c : CuckooStrategies.values()) System.out.println(c);
public static CuckooStrategies valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic abstract com.duprasville.guava.probably.CuckooStrategy strategy()
Copyright © 2016. All rights reserved.