Class OffHeapBitSet

java.lang.Object
org.apache.cassandra.utils.obs.OffHeapBitSet
All Implemented Interfaces:
Closeable, AutoCloseable, IBitSet

public class OffHeapBitSet extends Object implements IBitSet
Off-heap bitset, file compatible with OpeBitSet
  • Constructor Details

    • OffHeapBitSet

      public OffHeapBitSet(long numBits)
  • Method Details

    • capacity

      public long capacity()
      Specified by:
      capacity in interface IBitSet
    • offHeapSize

      public long offHeapSize()
      Description copied from interface: IBitSet
      Returns the amount of memory in bytes used off heap.
      Specified by:
      offHeapSize in interface IBitSet
      Returns:
      the amount of memory in bytes used off heap
    • addTo

      public void addTo(Ref.IdentityCollection identities)
      Specified by:
      addTo in interface IBitSet
    • get

      public boolean get(long index)
      Description copied from interface: IBitSet
      Returns true or false for the specified bit index. The index should be less than the capacity.
      Specified by:
      get in interface IBitSet
    • set

      public void set(long index)
      Description copied from interface: IBitSet
      Sets the bit at the specified index. The index should be less than the capacity.
      Specified by:
      set in interface IBitSet
    • set

      public void set(long offset, byte b)
    • clear

      public void clear(long index)
      Description copied from interface: IBitSet
      clears the bit. The index should be less than the capacity.
      Specified by:
      clear in interface IBitSet
    • clear

      public void clear()
      Specified by:
      clear in interface IBitSet
    • serialize

      public void serialize(DataOutputPlus out) throws IOException
      Specified by:
      serialize in interface IBitSet
      Throws:
      IOException
    • serializeOldBfFormat

      public void serializeOldBfFormat(DataOutputPlus out) throws IOException
      Throws:
      IOException
    • serializedSize

      public long serializedSize()
      Specified by:
      serializedSize in interface IBitSet
    • deserialize

      public static <I extends InputStream & DataInput> OffHeapBitSet deserialize(I in, boolean oldBfFormat) throws IOException
      Throws:
      IOException
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface IBitSet
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object