use of org.apache.cassandra.utils.obs.IBitSet in project cassandra by apache.
the class FilterFactory method createFilter.
@SuppressWarnings("resource")
private static IFilter createFilter(int hash, long numElements, int bucketsPer, boolean offheap) {
long numBits = (numElements * bucketsPer) + BITSET_EXCESS;
IBitSet bitset = offheap ? new OffHeapBitSet(numBits) : new OpenBitSet(numBits);
return new BloomFilter(hash, bitset);
}
use of org.apache.cassandra.utils.obs.IBitSet in project cassandra by apache.
the class BloomFilterSerializer method deserialize.
@SuppressWarnings("resource")
public static BloomFilter deserialize(DataInput in, boolean offheap) throws IOException {
int hashes = in.readInt();
IBitSet bs = offheap ? OffHeapBitSet.deserialize(in) : OpenBitSet.deserialize(in);
return new BloomFilter(hashes, bs);
}
Aggregations