Class ParallelMergeCombiningSequence<T>
java.lang.Object
org.apache.druid.java.util.common.guava.YieldingSequenceBase<T>
org.apache.druid.java.util.common.guava.ParallelMergeCombiningSequence<T>
- All Implemented Interfaces:
Sequence<T>
Artisanal, locally-sourced, hand-crafted, gluten and GMO free, bespoke, free-range, organic, small-batch parallel
merge combining sequence.
See proposal: https://github.com/apache/druid/issues/8577
Functionally equivalent to wrapping
CombiningSequence around a
MergeSequence, but done in parallel on a ForkJoinPool running in 'async' mode.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classListenableFuturethat allowsParallelMergeCombiningSequenceto be registered withQueryWatcher.registerQueryFuture(org.apache.druid.query.Query<?>, com.google.common.util.concurrent.ListenableFuture<?>)to participate in query cancellation or anything else that has a need to watch the activity on the merge pool.static classToken used to stop internal parallel processing across all tasks in the merge pool.static classMetrics for the execution of aParallelMergeCombiningSequenceon theForkJoinPool -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionParallelMergeCombiningSequence(ForkJoinPool workerPool, List<Sequence<T>> inputSequences, com.google.common.collect.Ordering<T> orderingFn, BinaryOperator<T> combineFn, boolean hasTimeout, long timeoutMillis, int queryPriority, int parallelism, int yieldAfter, int batchSize, int targetTimeMillis, Consumer<ParallelMergeCombiningSequence.MergeCombineMetrics> reporter) -
Method Summary
Modifier and TypeMethodDescription<OutType> Yielder<OutType>toYielder(OutType initValue, YieldingAccumulator<OutType, T> accumulator) Return a Yielder for accumulated sequence.Methods inherited from class org.apache.druid.java.util.common.guava.YieldingSequenceBase
accumulate
-
Field Details
-
DEFAULT_TASK_TARGET_RUN_TIME_MILLIS
public static final int DEFAULT_TASK_TARGET_RUN_TIME_MILLIS- See Also:
-
DEFAULT_TASK_INITIAL_YIELD_NUM_ROWS
public static final int DEFAULT_TASK_INITIAL_YIELD_NUM_ROWS- See Also:
-
DEFAULT_TASK_SMALL_BATCH_NUM_ROWS
public static final int DEFAULT_TASK_SMALL_BATCH_NUM_ROWS- See Also:
-
-
Constructor Details
-
ParallelMergeCombiningSequence
public ParallelMergeCombiningSequence(ForkJoinPool workerPool, List<Sequence<T>> inputSequences, com.google.common.collect.Ordering<T> orderingFn, BinaryOperator<T> combineFn, boolean hasTimeout, long timeoutMillis, int queryPriority, int parallelism, int yieldAfter, int batchSize, int targetTimeMillis, Consumer<ParallelMergeCombiningSequence.MergeCombineMetrics> reporter)
-
-
Method Details
-
toYielder
public <OutType> Yielder<OutType> toYielder(OutType initValue, YieldingAccumulator<OutType, T> accumulator) Description copied from interface:SequenceReturn a Yielder for accumulated sequence.- Type Parameters:
OutType- the type of accumulated value.- Parameters:
initValue- the initial value to pass along to start the accumulation.accumulator- the accumulator which is responsible for accumulating input values.- Returns:
- a Yielder for accumulated sequence.
- See Also:
-
getCancellationFuture
-