use of org.roaringbitmap.buffer.ImmutableRoaringBitmap in project druid by druid-io.
the class WrappedImmutableRoaringBitmap method intersection.
@Override
public ImmutableBitmap intersection(ImmutableBitmap otherBitmap) {
WrappedImmutableRoaringBitmap other = (WrappedImmutableRoaringBitmap) otherBitmap;
ImmutableRoaringBitmap unwrappedOtherBitmap = other.bitmap;
return new WrappedImmutableRoaringBitmap(ImmutableRoaringBitmap.and(bitmap, unwrappedOtherBitmap));
}
use of org.roaringbitmap.buffer.ImmutableRoaringBitmap in project druid by druid-io.
the class BitmapBenchmark method timeOffheapRoaringUnion.
@Test
public void timeOffheapRoaringUnion() throws Exception {
ImmutableRoaringBitmap union = BufferFastAggregation.horizontal_or(Lists.newArrayList(offheapRoaring).iterator());
Assert.assertEquals(unionCount, union.getCardinality());
}
use of org.roaringbitmap.buffer.ImmutableRoaringBitmap in project druid by druid-io.
the class BitmapBenchmark method writeImmutable.
protected static ImmutableRoaringBitmap writeImmutable(MutableRoaringBitmap r, ByteBuffer buf) throws IOException {
final ByteArrayOutputStream out = new ByteArrayOutputStream();
r.serialize(new DataOutputStream(out));
final byte[] bytes = out.toByteArray();
Assert.assertEquals(buf.remaining(), bytes.length);
buf.put(bytes);
buf.rewind();
return new ImmutableRoaringBitmap(buf.asReadOnlyBuffer());
}
use of org.roaringbitmap.buffer.ImmutableRoaringBitmap in project druid by druid-io.
the class BitmapBenchmark method timeImmutableRoaringUnion.
@Test
public void timeImmutableRoaringUnion() throws Exception {
ImmutableRoaringBitmap union = BufferFastAggregation.horizontal_or(Lists.newArrayList(immutableRoaring).iterator());
Assert.assertEquals(unionCount, union.getCardinality());
}
use of org.roaringbitmap.buffer.ImmutableRoaringBitmap in project druid by druid-io.
the class BitmapBenchmark method timeRoaringUnion.
@Test
public void timeRoaringUnion() throws Exception {
ImmutableRoaringBitmap union = BufferFastAggregation.horizontal_or(Lists.newArrayList(roaring).iterator());
Assert.assertEquals(unionCount, union.getCardinality());
}
Aggregations