Important Note
the order of the constants cannot change, and they cannot be deleted - we depend on their ordinal for BloomFilter serialization.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | BloomFilterStrategies.
Models a lock-free array of bits. |
| Modifier and Type | Field and Description |
|---|---|
| public static final BloomFilterStrategies | MURMUR128_MITZ_32
See "Less Hashing, Same Performance: Building a Better Bloom Filter" by Adam Kirsch and Michael Mitzenmacher. |
| public static final BloomFilterStrategies | MURMUR128_MITZ_64
This strategy uses all 128 bits of |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static BloomFilterStrategies | |
| public static BloomFilterStrategies[] |
| MURMUR128_MITZ_32 | back to summary |
|---|---|
| public static final BloomFilterStrategies MURMUR128_MITZ_32 See "Less Hashing, Same Performance: Building a Better Bloom Filter" by Adam Kirsch and Michael Mitzenmacher. The paper argues that this trick doesn't significantly deteriorate the performance of a Bloom filter (yet only needs two 32bit hash functions). | |
| MURMUR128_MITZ_64 | back to summary |
|---|---|
| public static final BloomFilterStrategies MURMUR128_MITZ_64 This strategy uses all 128 bits of | |
| BloomFilterStrategies | back to summary |
|---|---|
| private BloomFilterStrategies() | |
| valueOf | back to summary |
|---|---|
| public static BloomFilterStrategies valueOf(String name) | |
| values | back to summary |
|---|---|
| public static BloomFilterStrategies[] values() | |
We use this instead of java.util.BitSet because we need access to the array of longs and we need compare-and-swap.
| Modifier and Type | Field and Description |
|---|---|
| private final LongAddable | |
| pack-priv final AtomicLongArray | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv long | |
| pack-priv long | |
| pack-priv BloomFilterStrategies. | |
| pack-priv int | |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. |
| pack-priv boolean | |
| public int | |
| pack-priv void | |
| pack-priv void | putData(int i, long longValue)
ORs the bits encoded in the |
| pack-priv boolean | |
| public static long[] | toPlainArray(AtomicLongArray atomicLongArray)
Careful here: if threads are mutating the atomicLongArray while this method is executing, the final long[] will be a "rolling snapshot" of the state of the bit array. |
| bitCount | back to summary |
|---|---|
| private final LongAddable bitCount | |
| data | back to summary |
|---|---|
| pack-priv final AtomicLongArray data | |
| LONG_ADDRESSABLE_BITS | back to summary |
|---|---|
| private static final int LONG_ADDRESSABLE_BITS | |
| LockFreeBitArray | back to summary |
|---|---|
| pack-priv LockFreeBitArray(long bits) | |
| LockFreeBitArray | back to summary |
|---|---|
| pack-priv LockFreeBitArray(long[] data) | |
| bitCount | back to summary |
|---|---|
| pack-priv long bitCount() Number of set bits (1s). Note that because of concurrent set calls and uses of atomics, this bitCount is a (very) close *estimate* of the actual number of bits set. It's not possible to do better than an estimate without locking. Note that the number, if not exactly accurate, is *always* underestimating, never overestimating. | |
| bitSize | back to summary |
|---|---|
| pack-priv long bitSize() Number of bits | |
| copy | back to summary |
|---|---|
| pack-priv BloomFilterStrategies. | |
| dataLength | back to summary |
|---|---|
| pack-priv int dataLength() Returns the number of | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| get | back to summary |
|---|---|
| pack-priv boolean get(long bitIndex) | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| putAll | back to summary |
|---|---|
| pack-priv void putAll(BloomFilterStrategies. Combines the two BitArrays using bitwise OR. Note Because of the use of atomics, if the other LockFreeBitArray is being mutated while this operation is executing, not all of those new 1's may be set in the final state of this LockFreeBitArray. The ONLY guarantee provided is that all the bits that were set in the other LockFreeBitArray at the start of this method will be set in this LockFreeBitArray at the end of this method. | |
| putData | back to summary |
|---|---|
| pack-priv void putData(int i, long longValue) ORs the bits encoded in the | |
| set | back to summary |
|---|---|
| pack-priv boolean set(long bitIndex) Returns true if the bit changed value. | |
| toPlainArray | back to summary |
|---|---|
| public static long[] toPlainArray(AtomicLongArray atomicLongArray) Careful here: if threads are mutating the atomicLongArray while this method is executing, the final long[] will be a "rolling snapshot" of the state of the bit array. This is usually good enough, but should be kept in mind. | |