Search in sources :

Example 31 with BitmapFactory

use of io.druid.collections.bitmap.BitmapFactory in project druid by druid-io.

the class LinearGutmanSplitStrategyTest method testNumChildrenSize.

@Test
public void testNumChildrenSize() {
    BitmapFactory bf = new ConciseBitmapFactory();
    RTree tree = new RTree(2, new LinearGutmanSplitStrategy(0, 50, bf), bf);
    Random rand = new Random();
    for (int i = 0; i < 100; i++) {
        tree.insert(new float[] { rand.nextFloat(), rand.nextFloat() }, i);
    }
    Assert.assertTrue(getNumPoints(tree.getRoot()) >= tree.getSize());
}
Also used : ConciseBitmapFactory(io.druid.collections.bitmap.ConciseBitmapFactory) Random(java.util.Random) BitmapFactory(io.druid.collections.bitmap.BitmapFactory) ConciseBitmapFactory(io.druid.collections.bitmap.ConciseBitmapFactory) RoaringBitmapFactory(io.druid.collections.bitmap.RoaringBitmapFactory) RTree(io.druid.collections.spatial.RTree) Point(io.druid.collections.spatial.Point) Test(org.junit.Test)

Aggregations

BitmapFactory (io.druid.collections.bitmap.BitmapFactory)31 RoaringBitmapFactory (io.druid.collections.bitmap.RoaringBitmapFactory)27 ConciseBitmapFactory (io.druid.collections.bitmap.ConciseBitmapFactory)25 ImmutableBitmap (io.druid.collections.bitmap.ImmutableBitmap)23 LinearGutmanSplitStrategy (io.druid.collections.spatial.split.LinearGutmanSplitStrategy)21 Test (org.junit.Test)20 IntIterator (org.roaringbitmap.IntIterator)15 Random (java.util.Random)14 RadiusBound (io.druid.collections.spatial.search.RadiusBound)13 BitmapSerdeFactory (io.druid.segment.data.BitmapSerdeFactory)6 MutableBitmap (io.druid.collections.bitmap.MutableBitmap)5 ImmutableRTree (io.druid.collections.spatial.ImmutableRTree)5 BitmapIndex (io.druid.segment.column.BitmapIndex)5 Point (io.druid.collections.spatial.Point)4 RTree (io.druid.collections.spatial.RTree)4 BitmapIndexSelector (io.druid.query.filter.BitmapIndexSelector)4 RoaringBitmapSerdeFactory (io.druid.segment.data.RoaringBitmapSerdeFactory)4 Function (com.google.common.base.Function)3 RectangularBound (io.druid.collections.spatial.search.RectangularBound)3 GenericIndexed (io.druid.segment.data.GenericIndexed)3