Package org.apache.druid.query
Class FluentQueryRunner<T>
- java.lang.Object
-
- org.apache.druid.query.FluentQueryRunner<T>
-
- All Implemented Interfaces:
QueryRunner<T>
public class FluentQueryRunner<T> extends Object implements QueryRunner<T>
-
-
Constructor Summary
Constructors Constructor Description FluentQueryRunner(QueryRunner<T> runner, QueryToolChest<T,Query<T>> toolChest)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FluentQueryRunner<T>
applyPostMergeDecoration()
FluentQueryRunner<T>
applyPreMergeDecoration()
static <K,J extends Query<K>>
FluentQueryRunner<K>create(QueryRunner<K> runner, QueryToolChest<K,J> toolchest)
FluentQueryRunner<T>
emitCPUTimeMetric(ServiceEmitter emitter)
FluentQueryRunner<T>
emitCPUTimeMetric(ServiceEmitter emitter, AtomicLong accumulator)
FluentQueryRunner<T>
from(QueryRunner<T> runner)
FluentQueryRunner<T>
map(Function<QueryRunner<T>,QueryRunner<T>> mapFn)
FluentQueryRunner<T>
mergeResults()
FluentQueryRunner<T>
postProcess(PostProcessingOperator<T> postProcessing)
Sequence<T>
run(QueryPlus<T> queryPlus, ResponseContext responseContext)
Runs the given query and returns results in a time-ordered sequence.QueryRunner<T>
setToString(String toStringValue)
Sets the toString of the QueryRunner.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.query.QueryRunner
run
-
-
-
-
Constructor Detail
-
FluentQueryRunner
public FluentQueryRunner(QueryRunner<T> runner, QueryToolChest<T,Query<T>> toolChest)
-
-
Method Detail
-
create
public static <K,J extends Query<K>> FluentQueryRunner<K> create(QueryRunner<K> runner, QueryToolChest<K,J> toolchest)
-
run
public Sequence<T> run(QueryPlus<T> queryPlus, ResponseContext responseContext)
Description copied from interface:QueryRunner
Runs the given query and returns results in a time-ordered sequence.- Specified by:
run
in interfaceQueryRunner<T>
-
from
public FluentQueryRunner<T> from(QueryRunner<T> runner)
-
applyPostMergeDecoration
public FluentQueryRunner<T> applyPostMergeDecoration()
-
applyPreMergeDecoration
public FluentQueryRunner<T> applyPreMergeDecoration()
-
emitCPUTimeMetric
public FluentQueryRunner<T> emitCPUTimeMetric(ServiceEmitter emitter)
-
emitCPUTimeMetric
public FluentQueryRunner<T> emitCPUTimeMetric(ServiceEmitter emitter, AtomicLong accumulator)
-
postProcess
public FluentQueryRunner<T> postProcess(PostProcessingOperator<T> postProcessing)
-
mergeResults
public FluentQueryRunner<T> mergeResults()
-
map
public FluentQueryRunner<T> map(Function<QueryRunner<T>,QueryRunner<T>> mapFn)
-
setToString
public QueryRunner<T> setToString(String toStringValue)
Sets the toString of the QueryRunner. This is used because QueryRunner objects are often used as parameters for tests and the toString() value of the QueryRunners are used for the name of the test. This method doesn't return a FluentQueryRunner because it breaks the fluency.- Parameters:
toStringValue
- the value that the resulting QueryRunner should return from its toString method.- Returns:
- a QueryRunner that will return toStringValue from its toString method
-
-