Search in sources :

Example 6 with ImmutableRoaringBitmap

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));
}
Also used : ImmutableRoaringBitmap(org.roaringbitmap.buffer.ImmutableRoaringBitmap)

Example 7 with ImmutableRoaringBitmap

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());
}
Also used : ImmutableRoaringBitmap(org.roaringbitmap.buffer.ImmutableRoaringBitmap) Test(org.junit.Test)

Example 8 with ImmutableRoaringBitmap

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());
}
Also used : DataOutputStream(java.io.DataOutputStream) ImmutableRoaringBitmap(org.roaringbitmap.buffer.ImmutableRoaringBitmap) ByteArrayOutputStream(java.io.ByteArrayOutputStream)

Example 9 with ImmutableRoaringBitmap

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());
}
Also used : ImmutableRoaringBitmap(org.roaringbitmap.buffer.ImmutableRoaringBitmap) Test(org.junit.Test)

Example 10 with ImmutableRoaringBitmap

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());
}
Also used : ImmutableRoaringBitmap(org.roaringbitmap.buffer.ImmutableRoaringBitmap) Test(org.junit.Test)

Aggregations

ImmutableRoaringBitmap (org.roaringbitmap.buffer.ImmutableRoaringBitmap)18 ArrayList (java.util.ArrayList)5 MutableRoaringBitmap (org.roaringbitmap.buffer.MutableRoaringBitmap)5 BlockDocIdIterator (com.linkedin.pinot.core.common.BlockDocIdIterator)4 BlockDocIdSet (com.linkedin.pinot.core.common.BlockDocIdSet)3 BitmapInvertedIndexReader (com.linkedin.pinot.core.segment.index.readers.BitmapInvertedIndexReader)3 PinotDataBuffer (com.linkedin.pinot.core.segment.memory.PinotDataBuffer)3 Test (org.junit.Test)3 IntPair (com.linkedin.pinot.common.utils.Pairs.IntPair)2 AndDocIdIterator (com.linkedin.pinot.core.operator.dociditerators.AndDocIdIterator)2 BitmapDocIdIterator (com.linkedin.pinot.core.operator.dociditerators.BitmapDocIdIterator)2 RangelessBitmapDocIdIterator (com.linkedin.pinot.core.operator.dociditerators.RangelessBitmapDocIdIterator)2 ColumnMetadata (com.linkedin.pinot.core.segment.index.ColumnMetadata)2 SegmentMetadataImpl (com.linkedin.pinot.core.segment.index.SegmentMetadataImpl)2 ColumnIndexContainer (com.linkedin.pinot.core.segment.index.column.ColumnIndexContainer)2 ImmutableDictionaryReader (com.linkedin.pinot.core.segment.index.readers.ImmutableDictionaryReader)2 InvertedIndexReader (com.linkedin.pinot.core.segment.index.readers.InvertedIndexReader)2 SegmentDirectory (com.linkedin.pinot.core.segment.store.SegmentDirectory)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 DataOutputStream (java.io.DataOutputStream)2