Class FrameProcessorExecutor


  • public class FrameProcessorExecutor
    extends Object
    Manages execution of FrameProcessor in an ExecutorService. If you want single threaded execution, use Execs.singleThreaded(). It is not a good idea to use this with a same-thread executor like Execs.directExecutor(), because it will lead to deep call stacks.
    • Constructor Detail

      • FrameProcessorExecutor

        public FrameProcessorExecutor​(com.google.common.util.concurrent.ListeningExecutorService exec)
    • Method Detail

      • getExecutorService

        public com.google.common.util.concurrent.ListeningExecutorService getExecutorService()
        Returns the underlying executor service used by this executor.
      • runFully

        public <T> com.google.common.util.concurrent.ListenableFuture<T> runFully​(FrameProcessor<T> processor,
                                                                                  @Nullable
                                                                                  String cancellationId)
        Runs a processor until it is done, and returns a future that resolves when execution is complete. If "cancellationId" is provided, it can be used with the cancel(String) method to cancel all processors currently running with the same cancellationId.
      • runAllFully

        public <T,​R> com.google.common.util.concurrent.ListenableFuture<R> runAllFully​(ProcessorManager<T,​R> processorManager,
                                                                                             int maxOutstandingProcessors,
                                                                                             Bouncer bouncer,
                                                                                             @Nullable
                                                                                             String cancellationId)
        Runs a sequence of processors and returns a future that resolves when execution is complete. Returns a value accumulated using the provided accumulateFn.
        Parameters:
        processorManager - processors to run
        maxOutstandingProcessors - maximum number of processors to run at once
        bouncer - additional limiter on outstanding processors, beyond maxOutstandingProcessors. Useful when there is some finite resource being shared against multiple different calls to this method.
        cancellationId - optional cancellation id for runFully(org.apache.druid.frame.processor.FrameProcessor<T>, java.lang.String).