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`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `IBitSet` | `bitset`
    `int` | `hashCount`
    `boolean` | `oldBfHashOrder` CASSANDRA-8413: 3.0 (inverted) bloom filters have no 'static' bits caused by using the same upper bits for both bloom filter and token distribution.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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.IFilter

      `close`

    - ### Methods inherited from interface org.apache.cassandra.utils.concurrent.SharedCloseable

      `close`

- - ### Field Detail

    - #### bitset

          public final IBitSet bitset

    - #### hashCount

          public final int hashCount

    - #### oldBfHashOrder

          public final boolean oldBfHashOrder

      CASSANDRA-8413: 3.0 (inverted) bloom filters have no 'static' bits caused by using the same upper bits for both bloom filter and token distribution.

  - ### Method Detail

    - #### serializedSize

          public long serializedSize()

      Specified by:
        `serializedSize` in interface `IFilter`

    - #### getHashBuckets

          public long[] getHashBuckets(IFilter.FilterKey key,
                                       int hashCount,
                                       long max)

    - #### add

          public void add(IFilter.FilterKey key)

      Specified by:
        `add` in interface `IFilter`

    - #### isPresent

          public final boolean isPresent(IFilter.FilterKey key)

      Specified by:
        `isPresent` in interface `IFilter`

    - #### clear

          public void clear()

      Specified by:
        `clear` in interface `IFilter`

    - #### sharedCopy

          public IFilter sharedCopy()

      Specified by:
        `sharedCopy` in interface `SharedCloseable`
      Specified by:
        `sharedCopy` in interface `IFilter`
      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 interface `IFilter`
      Returns:
        the amount of memory in bytes used off heap

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### addTo

          public void addTo(Ref.IdentityCollection identities)

      Specified by:
        `addTo` in interface `SharedCloseable`
      Overrides:
        `addTo` in class `SharedCloseableImpl`

Copyright © 2018 The Apache Software Foundation