Package org.apache.cassandra.utils
Class BloomFilter
- java.lang.Object
-
- org.apache.cassandra.utils.concurrent.SharedCloseableImpl
-
- org.apache.cassandra.utils.concurrent.WrappedSharedCloseable
-
- org.apache.cassandra.utils.BloomFilter
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,SharedCloseable
,IFilter
public class BloomFilter extends WrappedSharedCloseable implements IFilter
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.cassandra.utils.IFilter
IFilter.FilterKey
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(IFilter.FilterKey key)
void
addTo(Ref.IdentityCollection identities)
void
clear()
long[]
getHashBuckets(IFilter.FilterKey key, int hashCount, long max)
boolean
isPresent(IFilter.FilterKey key)
long
offHeapSize()
Returns the amount of memory in bytes used off heap.long
serializedSize()
IFilter
sharedCopy()
java.lang.String
toString()
-
Methods inherited from class org.apache.cassandra.utils.concurrent.SharedCloseableImpl
close, close, isCleanedUp
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.utils.concurrent.SharedCloseable
close
-
-
-
-
Field Detail
-
bitset
public final IBitSet bitset
-
hashCount
public final int hashCount
-
-
Method Detail
-
serializedSize
public long serializedSize()
- Specified by:
serializedSize
in interfaceIFilter
-
getHashBuckets
public long[] getHashBuckets(IFilter.FilterKey key, int hashCount, long max)
-
add
public void add(IFilter.FilterKey key)
-
isPresent
public final boolean isPresent(IFilter.FilterKey key)
-
sharedCopy
public IFilter sharedCopy()
- Specified by:
sharedCopy
in interfaceIFilter
- Specified by:
sharedCopy
in interfaceSharedCloseable
- Returns:
- a new instance of the object representing the same state and backed by the same underlying resources. Coordinates with the original (and other instances) when the underlying resource should be closed. Throws an exception if the shared resource has already been closed.
-
offHeapSize
public long offHeapSize()
Description copied from interface:IFilter
Returns the amount of memory in bytes used off heap.- Specified by:
offHeapSize
in interfaceIFilter
- Returns:
- the amount of memory in bytes used off heap
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
addTo
public void addTo(Ref.IdentityCollection identities)
- Specified by:
addTo
in interfaceSharedCloseable
- Overrides:
addTo
in classSharedCloseableImpl
-
-