@Immutable public final class BloomFilterStatistics extends Object
Constructor and Description |
---|
BloomFilterStatistics(double configuredFalsePositiveProbability,
double expectedFalsePositiveProbability,
long capacity,
long bitSize,
long expiryTime,
long estimatedRemainingCapacity)
Constructs a statistics object with the given parameters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
long |
getBitSize()
The total memory size of the set, in bits.
|
long |
getCapacity()
The capacity of the set.
|
double |
getConfiguredFalsePositiveProbability()
The configured probability of false positives.
|
long |
getEstimatedRemainingCapacity()
Provides an estimate of the remaining capacity in this bloom filter before it would become saturated.
|
double |
getExpectedFalsePositiveProbability()
The expected probability of false positives given the current state of the set.
|
long |
getExpiryTime()
The time in milliseconds since the UTC epoch until the last element contained in this bloom filter expires.
|
int |
hashCode() |
boolean |
isSaturated()
Determines whether the bloom filter expected false positive probability has exceeded the configured false
positive probability.
|
static long |
optimumBitSize(long capacity,
double falsePositiveProbability)
Calculates the optimum size of a bloom filter (in bits) to achieve the given false positive probability and
expected number of insertions (capacity).
|
static long |
optimumRemainingCapacity(long bitSize,
double expectedFalsePositiveProbability,
long capacity)
Estimates the remaining capacity in an optimum Bloom Filter.
|
String |
toString() |
public BloomFilterStatistics(double configuredFalsePositiveProbability, double expectedFalsePositiveProbability, long capacity, long bitSize, long expiryTime, long estimatedRemainingCapacity)
configuredFalsePositiveProbability
- the false positive probability that was configured for this set.expectedFalsePositiveProbability
- the expected false positive probability given the current state of the
set.capacity
- the expected total number of insertions into the set before it becomes saturated
(exceeds the configured false positive probability).bitSize
- the total memory size of the set in bits.public double getConfiguredFalsePositiveProbability()
public double getExpectedFalsePositiveProbability()
public long getCapacity()
public long getBitSize()
public static long optimumBitSize(long capacity, double falsePositiveProbability)
capacity
- the expected number of insertions into the bloom filter.falsePositiveProbability
- the desired probability of false positives.public long getEstimatedRemainingCapacity()
public static long optimumRemainingCapacity(long bitSize, double expectedFalsePositiveProbability, long capacity)
bitSize
- the size of the Bloom Filter bit-vector in bits.expectedFalsePositiveProbability
- the expected current false positive probability of the bloom filter.capacity
- the overall expected capacity of the bloom filter.public long getExpiryTime()
public boolean isSaturated()
true
if the expected false positive probability is greater than the configured probability.Copyright © 2025 Open Identity Platform Community. All rights reserved.