Search in sources :

Example 1 with WrappedRoaringBitmap

use of org.apache.druid.collections.bitmap.WrappedRoaringBitmap in project druid by druid-io.

the class DistinctCountBufferAggregator method getMutableBitmap.

private MutableBitmap getMutableBitmap(int position) {
    MutableBitmap mutableBitmap = mutableBitmapCollection.get(position);
    if (mutableBitmap == null) {
        mutableBitmap = new WrappedRoaringBitmap();
        mutableBitmapCollection.put(position, mutableBitmap);
    }
    return mutableBitmap;
}
Also used : MutableBitmap(org.apache.druid.collections.bitmap.MutableBitmap) WrappedRoaringBitmap(org.apache.druid.collections.bitmap.WrappedRoaringBitmap)

Example 2 with WrappedRoaringBitmap

use of org.apache.druid.collections.bitmap.WrappedRoaringBitmap in project druid by druid-io.

the class VectorSelectorUtilsTest method testRoaringImmutableNullVector.

@Test
public void testRoaringImmutableNullVector() {
    WrappedRoaringBitmap bitmap = new WrappedRoaringBitmap();
    populate(bitmap, NULLS);
    assertNullVector(bitmap.toImmutableBitmap(), NULLS);
    WrappedRoaringBitmap bitmap2 = new WrappedRoaringBitmap();
    populate(bitmap2, NULLS_PATTERN);
    assertNullVector(bitmap2.toImmutableBitmap(), NULLS_PATTERN);
}
Also used : WrappedRoaringBitmap(org.apache.druid.collections.bitmap.WrappedRoaringBitmap) Test(org.junit.Test)

Example 3 with WrappedRoaringBitmap

use of org.apache.druid.collections.bitmap.WrappedRoaringBitmap in project druid by druid-io.

the class VectorSelectorUtilsTest method testRoaringMutableNullVector.

@Test
public void testRoaringMutableNullVector() {
    WrappedRoaringBitmap bitmap = new WrappedRoaringBitmap();
    populate(bitmap, NULLS);
    assertNullVector(bitmap, NULLS);
    WrappedRoaringBitmap bitmap2 = new WrappedRoaringBitmap();
    populate(bitmap2, NULLS_PATTERN);
    assertNullVector(bitmap2, NULLS_PATTERN);
}
Also used : WrappedRoaringBitmap(org.apache.druid.collections.bitmap.WrappedRoaringBitmap) Test(org.junit.Test)

Example 4 with WrappedRoaringBitmap

use of org.apache.druid.collections.bitmap.WrappedRoaringBitmap in project druid by druid-io.

the class NumericNullColumnSelectorTest method setup.

@Before
public void setup() {
    bitmaps = new ImmutableBitmap[numBitmaps];
    for (int bitmap = 0; bitmap < numBitmaps; bitmap++) {
        WrappedRoaringBitmap mutable = new WrappedRoaringBitmap();
        for (int i = 0; i < numRows; i++) {
            if (rando.nextDouble() > 0.2) {
                mutable.add(i);
            }
        }
        bitmaps[bitmap] = mutable.toImmutableBitmap();
    }
}
Also used : WrappedRoaringBitmap(org.apache.druid.collections.bitmap.WrappedRoaringBitmap) Before(org.junit.Before)

Aggregations

WrappedRoaringBitmap (org.apache.druid.collections.bitmap.WrappedRoaringBitmap)4 Test (org.junit.Test)2 MutableBitmap (org.apache.druid.collections.bitmap.MutableBitmap)1 Before (org.junit.Before)1