public final class BloomFilterMonitor<T> extends Object implements BloomFilterMXBean, BloomFilter<T>
Constructor and Description |
---|
BloomFilterMonitor(BloomFilter<T> delegate) |
Modifier and Type | Method and Description |
---|---|
void |
add(T element)
Adds the specified element to this set if it is not already possibly present.
|
void |
addAll(Collection<? extends T> elements)
Adds all of the specified elements to this set if they are not possibly already present.
|
double |
getConfiguredFalsePositiveProbability() |
long |
getCurrentCapacity() |
long |
getEstimatedRemainingCapacity() |
double |
getExpectedFalsePositiveProbability() |
Date |
getExpiryTime() |
long |
getMemorySizeKB() |
BloomFilterStatistics |
getStatistics()
Gets a snapshot of the current statistics of the set.
|
boolean |
mightContain(T element)
Checks if the given element might be a member of this set.
|
void |
register() |
void |
register(MBeanServer mBeanServer) |
ObjectInstance |
register(MBeanServer mBeanServer,
String packageName,
String instanceName) |
String |
toString() |
public BloomFilterMonitor(BloomFilter<T> delegate)
public ObjectInstance register(MBeanServer mBeanServer, String packageName, String instanceName) throws InstanceAlreadyExistsException, MBeanRegistrationException, MalformedObjectNameException
public void register(MBeanServer mBeanServer) throws InstanceAlreadyExistsException, MBeanRegistrationException
public void register() throws InstanceAlreadyExistsException, MBeanRegistrationException
public void add(T element)
BloomFilter
BloomFilter.mightContain(Object)
will return true
for the same object.add
in interface BloomFilter<T>
element
- the element to add to this set.public void addAll(Collection<? extends T> elements)
BloomFilter
addAll
in interface BloomFilter<T>
elements
- the elements to add to the set.public boolean mightContain(T element)
BloomFilter
false
, then
the given object is definitely not a member of the set. If the result is true
then the object may or
may not be a member of this set, with a certain probability of false positives.mightContain
in interface BloomFilter<T>
element
- the element to check for membership in this set.false
if the element is definitely not in the set, or true
if it might be.public BloomFilterStatistics getStatistics()
BloomFilter
getStatistics
in interface BloomFilter<T>
public double getConfiguredFalsePositiveProbability()
getConfiguredFalsePositiveProbability
in interface BloomFilterMXBean
public double getExpectedFalsePositiveProbability()
getExpectedFalsePositiveProbability
in interface BloomFilterMXBean
public long getCurrentCapacity()
getCurrentCapacity
in interface BloomFilterMXBean
public long getEstimatedRemainingCapacity()
getEstimatedRemainingCapacity
in interface BloomFilterMXBean
public long getMemorySizeKB()
getMemorySizeKB
in interface BloomFilterMXBean
public Date getExpiryTime()
getExpiryTime
in interface BloomFilterMXBean
Copyright © 2010-2020, ForgeRock All Rights Reserved.