Class ControlledWorkerUnion<T>

All Implemented Interfaces:
AutoCloseable, Runnable, CloseableIteration<T,QueryEvaluationException>, Iteration<T,QueryEvaluationException>, ParallelExecutor<T>

public class ControlledWorkerUnion<T> extends WorkerUnionBase<T>
Execution of union tasks with ControlledWorkerScheduler. Tasks can be added using the provided functions. Note that the union operation is to be executed with the ParallelExecutorBase.run() method (also threaded execution is possible). Results are then contained in this iteration.
Author:
Andreas Schwarte
  • Field Details

    • waitingCount

      public static int waitingCount
    • awakeCount

      public static int awakeCount
    • scheduler

      protected final ControlledWorkerScheduler<T> scheduler
    • phaser

      protected final Phaser phaser
  • Constructor Details

  • Method Details

    • union

      protected void union() throws Exception
      Description copied from class: UnionExecutorBase
      Note: this method must block until the union is executed completely. Otherwise the result queue is marked as committed while this isn't the case. The blocking behavior in general is no problem: If you need concurrent access to the result (i.e. pipelining) just run the union in a separate thread. Access to the result iteration is synchronized.
      Specified by:
      union in class UnionExecutorBase<T>
      Throws:
      Exception
    • done

      public void done()
      Description copied from interface: ParallelExecutor
      Inform the controlling instance that some job is done from a different thread. In most cases this is a no-op.
      Specified by:
      done in interface ParallelExecutor<T>
      Overrides:
      done in class ParallelExecutorBase<T>
    • toss

      public void toss(Exception e)
      Description copied from interface: ParallelExecutor
      Toss some exception to the controlling instance
      Specified by:
      toss in interface ParallelExecutor<T>
      Overrides:
      toss in class ParallelExecutorBase<T>