Search in sources :

Example 1 with ImmutableConciseSet

use of io.druid.extendedset.intset.ImmutableConciseSet in project druid by druid-io.

the class ConciseComplementBenchmark method uncompressed.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void uncompressed(Blackhole blackhole) {
    final ImmutableConciseSet set = ImmutableConciseSet.complement(null, emptyRows);
    blackhole.consume(set);
    assert (emptyRows == set.size());
}
Also used : ImmutableConciseSet(io.druid.extendedset.intset.ImmutableConciseSet) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 2 with ImmutableConciseSet

use of io.druid.extendedset.intset.ImmutableConciseSet in project druid by druid-io.

the class BitmapBenchmark method makeOffheapConcise.

protected static ImmutableConciseSet makeOffheapConcise(ImmutableConciseSet concise) {
    final byte[] bytes = concise.toBytes();
    totalConciseBytes += bytes.length;
    conciseCount++;
    final ByteBuffer buf = ByteBuffer.allocateDirect(bytes.length).put(bytes);
    buf.rewind();
    return new ImmutableConciseSet(buf);
}
Also used : ImmutableConciseSet(io.druid.extendedset.intset.ImmutableConciseSet) ByteBuffer(java.nio.ByteBuffer)

Example 3 with ImmutableConciseSet

use of io.druid.extendedset.intset.ImmutableConciseSet in project druid by druid-io.

the class WrappedImmutableConciseBitmap method intersection.

@Override
public ImmutableBitmap intersection(ImmutableBitmap otherBitmap) {
    WrappedImmutableConciseBitmap other = (WrappedImmutableConciseBitmap) otherBitmap;
    ImmutableConciseSet unwrappedOtherBitmap = other.bitmap;
    return new WrappedImmutableConciseBitmap(ImmutableConciseSet.intersection(bitmap, unwrappedOtherBitmap));
}
Also used : ImmutableConciseSet(io.druid.extendedset.intset.ImmutableConciseSet)

Example 4 with ImmutableConciseSet

use of io.druid.extendedset.intset.ImmutableConciseSet in project druid by druid-io.

the class WrappedImmutableConciseBitmap method union.

@Override
public ImmutableBitmap union(ImmutableBitmap otherBitmap) {
    WrappedImmutableConciseBitmap other = (WrappedImmutableConciseBitmap) otherBitmap;
    ImmutableConciseSet unwrappedOtherBitmap = other.bitmap;
    return new WrappedImmutableConciseBitmap(ImmutableConciseSet.union(bitmap, unwrappedOtherBitmap));
}
Also used : ImmutableConciseSet(io.druid.extendedset.intset.ImmutableConciseSet)

Example 5 with ImmutableConciseSet

use of io.druid.extendedset.intset.ImmutableConciseSet in project druid by druid-io.

the class WrappedImmutableConciseBitmap method difference.

@Override
public ImmutableBitmap difference(ImmutableBitmap otherBitmap) {
    WrappedImmutableConciseBitmap other = (WrappedImmutableConciseBitmap) otherBitmap;
    ImmutableConciseSet unwrappedOtherBitmap = other.bitmap;
    return new WrappedImmutableConciseBitmap(ImmutableConciseSet.intersection(bitmap, ImmutableConciseSet.complement(unwrappedOtherBitmap)));
}
Also used : ImmutableConciseSet(io.druid.extendedset.intset.ImmutableConciseSet)

Aggregations

ImmutableConciseSet (io.druid.extendedset.intset.ImmutableConciseSet)7 BenchmarkOptions (com.carrotsearch.junitbenchmarks.BenchmarkOptions)2 Test (org.junit.Test)2 ByteBuffer (java.nio.ByteBuffer)1 Benchmark (org.openjdk.jmh.annotations.Benchmark)1 BenchmarkMode (org.openjdk.jmh.annotations.BenchmarkMode)1 OutputTimeUnit (org.openjdk.jmh.annotations.OutputTimeUnit)1