org.eclipse.rdf4j.federated.evaluation.union

## Class UnionExecutorBase<T>

- java.lang.Object
- - org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<E,X>
  - - org.eclipse.rdf4j.common.iteration.LookAheadIteration<T,QueryEvaluationException>
    - - org.eclipse.rdf4j.federated.evaluation.concurrent.ParallelExecutorBase<T>
      - - org.eclipse.rdf4j.federated.evaluation.union.UnionExecutorBase<T>

- All Implemented Interfaces:
    AutoCloseable, Runnable, CloseableIteration<T,QueryEvaluationException>, Iteration<T,QueryEvaluationException>, ParallelExecutor<T>
  Direct Known Subclasses:
    WorkerUnionBase

      public abstract class UnionExecutorBase<T>
      extends ParallelExecutorBase<T>

  Base class for any parallel union executor. Note that this class extends `LookAheadIteration` and thus any implementation of this class is applicable for pipelining when used in a different thread (access to shared variables is synchronized).
  Author:
    Andreas Schwarte

- - ### Field Summary

    - ### Fields inherited from class org.eclipse.rdf4j.federated.evaluation.concurrent.ParallelExecutorBase

      `closed, evaluationThread, executorId, finished, log, NEXT_EXECUTOR_ID, queryInfo, rightIter, rightQueue, strategy`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UnionExecutorBase(FederationEvalStrategy strategy, QueryInfo queryInfo)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String` | `getExecutorType()`
    `protected void` | `performExecution()` Perform the parallel execution.
    `protected abstract void` | `union()` Note: this method must block until the union is executed completely.

    - ### Methods inherited from class org.eclipse.rdf4j.federated.evaluation.concurrent.ParallelExecutorBase

      `addResult, checkTimeout, done, getDisplayId, getId, getNextElement, getQueryInfo, handleClose, isFinished, run, toss, toString`

    - ### Methods inherited from class org.eclipse.rdf4j.common.iteration.LookAheadIteration

      `hasNext, next, remove`

    - ### Methods inherited from class org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration

      `close, isClosed`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.rdf4j.common.iteration.Iteration

      `stream`

- - ### Constructor Detail

    - #### UnionExecutorBase

          public UnionExecutorBase(FederationEvalStrategy strategy,
                                   QueryInfo queryInfo)

  - ### Method Detail

    - #### performExecution

          protected final void performExecution()
                                         throws Exception

      Description copied from class: `ParallelExecutorBase`
      Perform the parallel execution. Note that this method must block until the execution is completed.
      Specified by:
        `performExecution` in class `ParallelExecutorBase<T>`
      Throws:
        `Exception`

    - #### union

          protected abstract void union()
                                 throws Exception

      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.
      Throws:
        `Exception`

    - #### getExecutorType

          protected String getExecutorType()

      Overrides:
        `getExecutorType` in class `ParallelExecutorBase<T>`
      Returns:
        the executor type, e.g. "Join". Default "Executor"

Copyright © 2015-2021 Eclipse Foundation. All Rights Reserved.