Search in sources :

Example 21 with StorageAdapter

use of org.apache.druid.segment.StorageAdapter in project druid by druid-io.

the class FilterPartitionBenchmark method readWithExFnPostFilter.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void readWithExFnPostFilter(Blackhole blackhole) {
    Filter filter = new NoBitmapSelectorDimFilter("dimSequential", "super-199", JS_EXTRACTION_FN).toFilter();
    StorageAdapter sa = new QueryableIndexStorageAdapter(qIndex);
    Sequence<Cursor> cursors = makeCursors(sa, filter);
    readCursors(cursors, blackhole);
}
Also used : DimensionPredicateFilter(org.apache.druid.segment.filter.DimensionPredicateFilter) SelectorDimFilter(org.apache.druid.query.filter.SelectorDimFilter) OrFilter(org.apache.druid.segment.filter.OrFilter) AndDimFilter(org.apache.druid.query.filter.AndDimFilter) SelectorFilter(org.apache.druid.segment.filter.SelectorFilter) DimFilter(org.apache.druid.query.filter.DimFilter) BoundFilter(org.apache.druid.segment.filter.BoundFilter) BoundDimFilter(org.apache.druid.query.filter.BoundDimFilter) AndFilter(org.apache.druid.segment.filter.AndFilter) OrDimFilter(org.apache.druid.query.filter.OrDimFilter) Filter(org.apache.druid.query.filter.Filter) StorageAdapter(org.apache.druid.segment.StorageAdapter) QueryableIndexStorageAdapter(org.apache.druid.segment.QueryableIndexStorageAdapter) QueryableIndexStorageAdapter(org.apache.druid.segment.QueryableIndexStorageAdapter) Cursor(org.apache.druid.segment.Cursor) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 22 with StorageAdapter

use of org.apache.druid.segment.StorageAdapter in project druid by druid-io.

the class FilterPartitionBenchmark method stringRead.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void stringRead(Blackhole blackhole) {
    StorageAdapter sa = new QueryableIndexStorageAdapter(qIndex);
    Sequence<Cursor> cursors = makeCursors(sa, null);
    readCursors(cursors, blackhole);
}
Also used : StorageAdapter(org.apache.druid.segment.StorageAdapter) QueryableIndexStorageAdapter(org.apache.druid.segment.QueryableIndexStorageAdapter) QueryableIndexStorageAdapter(org.apache.druid.segment.QueryableIndexStorageAdapter) Cursor(org.apache.druid.segment.Cursor) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 23 with StorageAdapter

use of org.apache.druid.segment.StorageAdapter in project druid by druid-io.

the class FilterPartitionBenchmark method readComplexOrFilter.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void readComplexOrFilter(Blackhole blackhole) {
    DimFilter dimFilter1 = new OrDimFilter(Arrays.asList(new SelectorDimFilter("dimSequential", "199", null), new AndDimFilter(Arrays.asList(new NoBitmapSelectorDimFilter("dimMultivalEnumerated2", "Corundum", null), new SelectorDimFilter("dimMultivalEnumerated", "Bar", null)))));
    DimFilter dimFilter2 = new OrDimFilter(Arrays.asList(new SelectorDimFilter("dimSequential", "299", null), new SelectorDimFilter("dimSequential", "399", null), new AndDimFilter(Arrays.asList(new NoBitmapSelectorDimFilter("dimMultivalEnumerated2", "Xylophone", null), new SelectorDimFilter("dimMultivalEnumerated", "Foo", null)))));
    DimFilter dimFilter3 = new OrDimFilter(Arrays.asList(dimFilter1, dimFilter2, new AndDimFilter(Arrays.asList(new NoBitmapSelectorDimFilter("dimMultivalEnumerated2", "Orange", null), new SelectorDimFilter("dimMultivalEnumerated", "World", null)))));
    StorageAdapter sa = new QueryableIndexStorageAdapter(qIndex);
    Sequence<Cursor> cursors = makeCursors(sa, dimFilter3.toFilter());
    readCursors(cursors, blackhole);
}
Also used : AndDimFilter(org.apache.druid.query.filter.AndDimFilter) SelectorDimFilter(org.apache.druid.query.filter.SelectorDimFilter) OrDimFilter(org.apache.druid.query.filter.OrDimFilter) StorageAdapter(org.apache.druid.segment.StorageAdapter) QueryableIndexStorageAdapter(org.apache.druid.segment.QueryableIndexStorageAdapter) QueryableIndexStorageAdapter(org.apache.druid.segment.QueryableIndexStorageAdapter) Cursor(org.apache.druid.segment.Cursor) SelectorDimFilter(org.apache.druid.query.filter.SelectorDimFilter) AndDimFilter(org.apache.druid.query.filter.AndDimFilter) DimFilter(org.apache.druid.query.filter.DimFilter) BoundDimFilter(org.apache.druid.query.filter.BoundDimFilter) OrDimFilter(org.apache.druid.query.filter.OrDimFilter) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 24 with StorageAdapter

use of org.apache.druid.segment.StorageAdapter in project druid by druid-io.

the class FilterPartitionBenchmark method readWithExFnPreFilter.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void readWithExFnPreFilter(Blackhole blackhole) {
    Filter filter = new SelectorDimFilter("dimSequential", "super-199", JS_EXTRACTION_FN).toFilter();
    StorageAdapter sa = new QueryableIndexStorageAdapter(qIndex);
    Sequence<Cursor> cursors = makeCursors(sa, filter);
    readCursors(cursors, blackhole);
}
Also used : DimensionPredicateFilter(org.apache.druid.segment.filter.DimensionPredicateFilter) SelectorDimFilter(org.apache.druid.query.filter.SelectorDimFilter) OrFilter(org.apache.druid.segment.filter.OrFilter) AndDimFilter(org.apache.druid.query.filter.AndDimFilter) SelectorFilter(org.apache.druid.segment.filter.SelectorFilter) DimFilter(org.apache.druid.query.filter.DimFilter) BoundFilter(org.apache.druid.segment.filter.BoundFilter) BoundDimFilter(org.apache.druid.query.filter.BoundDimFilter) AndFilter(org.apache.druid.segment.filter.AndFilter) OrDimFilter(org.apache.druid.query.filter.OrDimFilter) Filter(org.apache.druid.query.filter.Filter) SelectorDimFilter(org.apache.druid.query.filter.SelectorDimFilter) StorageAdapter(org.apache.druid.segment.StorageAdapter) QueryableIndexStorageAdapter(org.apache.druid.segment.QueryableIndexStorageAdapter) QueryableIndexStorageAdapter(org.apache.druid.segment.QueryableIndexStorageAdapter) Cursor(org.apache.druid.segment.Cursor) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 25 with StorageAdapter

use of org.apache.druid.segment.StorageAdapter in project druid by druid-io.

the class FilterPartitionBenchmark method readWithPreFilter.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void readWithPreFilter(Blackhole blackhole) {
    Filter filter = new SelectorFilter("dimSequential", "199");
    StorageAdapter sa = new QueryableIndexStorageAdapter(qIndex);
    Sequence<Cursor> cursors = makeCursors(sa, filter);
    readCursors(cursors, blackhole);
}
Also used : SelectorFilter(org.apache.druid.segment.filter.SelectorFilter) DimensionPredicateFilter(org.apache.druid.segment.filter.DimensionPredicateFilter) SelectorDimFilter(org.apache.druid.query.filter.SelectorDimFilter) OrFilter(org.apache.druid.segment.filter.OrFilter) AndDimFilter(org.apache.druid.query.filter.AndDimFilter) SelectorFilter(org.apache.druid.segment.filter.SelectorFilter) DimFilter(org.apache.druid.query.filter.DimFilter) BoundFilter(org.apache.druid.segment.filter.BoundFilter) BoundDimFilter(org.apache.druid.query.filter.BoundDimFilter) AndFilter(org.apache.druid.segment.filter.AndFilter) OrDimFilter(org.apache.druid.query.filter.OrDimFilter) Filter(org.apache.druid.query.filter.Filter) StorageAdapter(org.apache.druid.segment.StorageAdapter) QueryableIndexStorageAdapter(org.apache.druid.segment.QueryableIndexStorageAdapter) QueryableIndexStorageAdapter(org.apache.druid.segment.QueryableIndexStorageAdapter) Cursor(org.apache.druid.segment.Cursor) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Aggregations

StorageAdapter (org.apache.druid.segment.StorageAdapter)39 Cursor (org.apache.druid.segment.Cursor)22 QueryableIndexStorageAdapter (org.apache.druid.segment.QueryableIndexStorageAdapter)22 Test (org.junit.Test)16 Benchmark (org.openjdk.jmh.annotations.Benchmark)14 BenchmarkMode (org.openjdk.jmh.annotations.BenchmarkMode)14 OutputTimeUnit (org.openjdk.jmh.annotations.OutputTimeUnit)14 Filter (org.apache.druid.query.filter.Filter)13 DimensionSelector (org.apache.druid.segment.DimensionSelector)11 InitializedNullHandlingTest (org.apache.druid.testing.InitializedNullHandlingTest)11 DimFilter (org.apache.druid.query.filter.DimFilter)10 SelectorFilter (org.apache.druid.segment.filter.SelectorFilter)10 Interval (org.joda.time.Interval)10 List (java.util.List)9 AndDimFilter (org.apache.druid.query.filter.AndDimFilter)9 BoundDimFilter (org.apache.druid.query.filter.BoundDimFilter)9 OrDimFilter (org.apache.druid.query.filter.OrDimFilter)9 SelectorDimFilter (org.apache.druid.query.filter.SelectorDimFilter)9 ColumnSelectorFactory (org.apache.druid.segment.ColumnSelectorFactory)8 Filters (org.apache.druid.segment.filter.Filters)8