Search in sources :

Example 6 with QueryableIndexSegment

use of io.druid.segment.QueryableIndexSegment in project druid by druid-io.

the class SpecificSegmentsQuerySegmentWalker method add.

public SpecificSegmentsQuerySegmentWalker add(final DataSegment descriptor, final QueryableIndex index) {
    final Segment segment = new QueryableIndexSegment(descriptor.getIdentifier(), index);
    if (!timelines.containsKey(descriptor.getDataSource())) {
        timelines.put(descriptor.getDataSource(), new VersionedIntervalTimeline<String, Segment>(Ordering.natural()));
    }
    final VersionedIntervalTimeline<String, Segment> timeline = timelines.get(descriptor.getDataSource());
    timeline.add(descriptor.getInterval(), descriptor.getVersion(), descriptor.getShardSpec().createChunk(segment));
    segments.add(descriptor);
    closeables.add(index);
    return this;
}
Also used : QueryableIndexSegment(io.druid.segment.QueryableIndexSegment) DataSegment(io.druid.timeline.DataSegment) Segment(io.druid.segment.Segment) QueryableIndexSegment(io.druid.segment.QueryableIndexSegment)

Example 7 with QueryableIndexSegment

use of io.druid.segment.QueryableIndexSegment in project druid by druid-io.

the class TopNTypeInterfaceBenchmark method querySingleQueryableIndexLongThenString.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void querySingleQueryableIndexLongThenString(Blackhole blackhole) throws Exception {
    QueryRunner<Result<TopNResultValue>> runner = QueryBenchmarkUtil.makeQueryRunner(factory, "qIndex", new QueryableIndexSegment("qIndex", qIndexes.get(0)));
    List<Result<TopNResultValue>> results = TopNTypeInterfaceBenchmark.runQuery(factory, runner, longQuery);
    for (Result<TopNResultValue> result : results) {
        blackhole.consume(result);
    }
    runner = QueryBenchmarkUtil.makeQueryRunner(factory, "qIndex", new QueryableIndexSegment("qIndex", qIndexes.get(0)));
    results = TopNTypeInterfaceBenchmark.runQuery(factory, runner, stringQuery);
    for (Result<TopNResultValue> result : results) {
        blackhole.consume(result);
    }
}
Also used : QueryableIndexSegment(io.druid.segment.QueryableIndexSegment) TopNResultValue(io.druid.query.topn.TopNResultValue) Result(io.druid.query.Result) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 8 with QueryableIndexSegment

use of io.druid.segment.QueryableIndexSegment in project druid by druid-io.

the class TopNTypeInterfaceBenchmark method querySingleQueryableIndexStringTwice.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void querySingleQueryableIndexStringTwice(Blackhole blackhole) throws Exception {
    QueryRunner<Result<TopNResultValue>> runner = QueryBenchmarkUtil.makeQueryRunner(factory, "qIndex", new QueryableIndexSegment("qIndex", qIndexes.get(0)));
    List<Result<TopNResultValue>> results = TopNTypeInterfaceBenchmark.runQuery(factory, runner, stringQuery);
    for (Result<TopNResultValue> result : results) {
        blackhole.consume(result);
    }
    runner = QueryBenchmarkUtil.makeQueryRunner(factory, "qIndex", new QueryableIndexSegment("qIndex", qIndexes.get(0)));
    results = TopNTypeInterfaceBenchmark.runQuery(factory, runner, stringQuery);
    for (Result<TopNResultValue> result : results) {
        blackhole.consume(result);
    }
}
Also used : QueryableIndexSegment(io.druid.segment.QueryableIndexSegment) TopNResultValue(io.druid.query.topn.TopNResultValue) Result(io.druid.query.Result) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 9 with QueryableIndexSegment

use of io.druid.segment.QueryableIndexSegment in project druid by druid-io.

the class GroupByBenchmark method querySingleQueryableIndex.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void querySingleQueryableIndex(Blackhole blackhole) throws Exception {
    QueryRunner<Row> runner = QueryBenchmarkUtil.makeQueryRunner(factory, "qIndex", new QueryableIndexSegment("qIndex", queryableIndexes.get(0)));
    List<Row> results = GroupByBenchmark.runQuery(factory, runner, query);
    for (Row result : results) {
        blackhole.consume(result);
    }
}
Also used : QueryableIndexSegment(io.druid.segment.QueryableIndexSegment) InputRow(io.druid.data.input.InputRow) Row(io.druid.data.input.Row) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 10 with QueryableIndexSegment

use of io.druid.segment.QueryableIndexSegment in project druid by druid-io.

the class TopNTypeInterfaceBenchmark method querySingleQueryableIndexStringThenLong.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void querySingleQueryableIndexStringThenLong(Blackhole blackhole) throws Exception {
    QueryRunner<Result<TopNResultValue>> runner = QueryBenchmarkUtil.makeQueryRunner(factory, "qIndex", new QueryableIndexSegment("qIndex", qIndexes.get(0)));
    List<Result<TopNResultValue>> results = TopNTypeInterfaceBenchmark.runQuery(factory, runner, stringQuery);
    for (Result<TopNResultValue> result : results) {
        blackhole.consume(result);
    }
    runner = QueryBenchmarkUtil.makeQueryRunner(factory, "qIndex", new QueryableIndexSegment("qIndex", qIndexes.get(0)));
    results = TopNTypeInterfaceBenchmark.runQuery(factory, runner, longQuery);
    for (Result<TopNResultValue> result : results) {
        blackhole.consume(result);
    }
}
Also used : QueryableIndexSegment(io.druid.segment.QueryableIndexSegment) TopNResultValue(io.druid.query.topn.TopNResultValue) Result(io.druid.query.Result) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Aggregations

QueryableIndexSegment (io.druid.segment.QueryableIndexSegment)56 Benchmark (org.openjdk.jmh.annotations.Benchmark)37 BenchmarkMode (org.openjdk.jmh.annotations.BenchmarkMode)37 OutputTimeUnit (org.openjdk.jmh.annotations.OutputTimeUnit)37 Result (io.druid.query.Result)22 Row (io.druid.data.input.Row)19 InputRow (io.druid.data.input.InputRow)16 TopNResultValue (io.druid.query.topn.TopNResultValue)15 IncrementalIndexSegment (io.druid.segment.IncrementalIndexSegment)9 QueryRunner (io.druid.query.QueryRunner)7 FinalizeResultsQueryRunner (io.druid.query.FinalizeResultsQueryRunner)5 DefaultDimensionSpec (io.druid.query.dimension.DefaultDimensionSpec)5 QueryableIndex (io.druid.segment.QueryableIndex)5 Test (org.junit.Test)5 QueryToolChest (io.druid.query.QueryToolChest)4 CountAggregatorFactory (io.druid.query.aggregation.CountAggregatorFactory)4 SelectorDimFilter (io.druid.query.filter.SelectorDimFilter)4 GroupByQueryRunnerTest (io.druid.query.groupby.GroupByQueryRunnerTest)4 TimeseriesResultValue (io.druid.query.timeseries.TimeseriesResultValue)4 IndexSpec (io.druid.segment.IndexSpec)4