use of io.druid.extendedset.intset.ConciseSet in project druid by druid-io.
the class WrappedConciseBitmap method or.
@Override
public void or(MutableBitmap mutableBitmap) {
WrappedConciseBitmap other = (WrappedConciseBitmap) mutableBitmap;
ConciseSet unwrappedOtherBitmap = other.bitmap;
bitmap.addAll(unwrappedOtherBitmap);
}
use of io.druid.extendedset.intset.ConciseSet in project druid by druid-io.
the class WrappedConciseBitmap method xor.
@Override
public void xor(MutableBitmap mutableBitmap) {
WrappedConciseBitmap other = (WrappedConciseBitmap) mutableBitmap;
ConciseSet unwrappedOtherBitmap = other.bitmap;
bitmap = bitmap.symmetricDifference(unwrappedOtherBitmap);
}
use of io.druid.extendedset.intset.ConciseSet in project druid by druid-io.
the class WrappedConciseBitmap method difference.
@Override
public ImmutableBitmap difference(ImmutableBitmap otherBitmap) {
WrappedConciseBitmap other = (WrappedConciseBitmap) otherBitmap;
ConciseSet unwrappedOtherBitmap = other.bitmap;
return new WrappedConciseBitmap(bitmap.clone().difference(unwrappedOtherBitmap));
}
use of io.druid.extendedset.intset.ConciseSet in project druid by druid-io.
the class WrappedConciseBitmap method and.
@Override
public void and(MutableBitmap mutableBitmap) {
WrappedConciseBitmap other = (WrappedConciseBitmap) mutableBitmap;
ConciseSet unwrappedOtherBitmap = other.bitmap;
bitmap = bitmap.intersection(unwrappedOtherBitmap);
}
use of io.druid.extendedset.intset.ConciseSet in project druid by druid-io.
the class ConciseBitmapFactoryTest method testGetOutOfBounds.
@Test
public void testGetOutOfBounds() {
final ConciseSet conciseSet = new ConciseSet();
final Set<Integer> ints = ImmutableSet.of(0, 4, 9);
for (int i : ints) {
conciseSet.add(i);
}
final ImmutableBitmap immutableBitmap = new WrappedImmutableConciseBitmap(ImmutableConciseSet.newImmutableFromMutable(conciseSet));
final MutableBitmap mutableBitmap = new WrappedConciseBitmap(conciseSet);
for (int i = 0; i < 10; ++i) {
Assert.assertEquals(Integer.toString(i), ints.contains(i), mutableBitmap.get(i));
Assert.assertEquals(Integer.toString(i), ints.contains(i), immutableBitmap.get(i));
}
}
Aggregations