Package org.apache.cassandra.utils.obs
Class OffHeapBitSet
java.lang.Object
org.apache.cassandra.utils.obs.OffHeapBitSet
- All Implemented Interfaces:
Closeable,AutoCloseable,IBitSet
Off-heap bitset,
file compatible with OpeBitSet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTo(Ref.IdentityCollection identities) longcapacity()voidclear()voidclear(long index) clears the bit.voidclose()static <I extends InputStream & DataInput>
OffHeapBitSetdeserialize(I in, boolean oldBfFormat) booleanbooleanget(long index) Returns true or false for the specified bit index.inthashCode()longReturns the amount of memory in bytes used off heap.voidserialize(DataOutputPlus out) longvoidvoidset(long index) Sets the bit at the specified index.voidset(long offset, byte b) toString()
-
Constructor Details
-
OffHeapBitSet
public OffHeapBitSet(long numBits)
-
-
Method Details
-
capacity
public long capacity() -
offHeapSize
public long offHeapSize()Description copied from interface:IBitSetReturns the amount of memory in bytes used off heap.- Specified by:
offHeapSizein interfaceIBitSet- Returns:
- the amount of memory in bytes used off heap
-
addTo
-
get
public boolean get(long index) Description copied from interface:IBitSetReturns true or false for the specified bit index. The index should be less than the capacity. -
set
public void set(long index) Description copied from interface:IBitSetSets the bit at the specified index. The index should be less than the capacity. -
set
public void set(long offset, byte b) -
clear
public void clear(long index) Description copied from interface:IBitSetclears the bit. The index should be less than the capacity. -
clear
public void clear() -
serialize
- Specified by:
serializein interfaceIBitSet- Throws:
IOException
-
serializeOldBfFormat
- Throws:
IOException
-
serializedSize
public long serializedSize()- Specified by:
serializedSizein interfaceIBitSet
-
deserialize
public static <I extends InputStream & DataInput> OffHeapBitSet deserialize(I in, boolean oldBfFormat) throws IOException - Throws:
IOException
-
close
public void close() -
equals
-
hashCode
public int hashCode() -
toString
-