Class UnionExecutorBase<T>
java.lang.Object
org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<T>
org.eclipse.rdf4j.common.iteration.LookAheadIteration<T>
org.eclipse.rdf4j.federated.evaluation.concurrent.ParallelExecutorBase<T>
org.eclipse.rdf4j.federated.evaluation.union.UnionExecutorBase<T>
- All Implemented Interfaces:
AutoCloseable, Runnable, Iterator<T>, CloseableIteration<T>, ParallelExecutor<T>
- Direct Known Subclasses:
WorkerUnionBase
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 ParallelExecutorBase
evaluationThread, executorId, finished, log, NEXT_EXECUTOR_ID, queryInfo, rightIter, rightQueue, strategyModifier and TypeFieldDescriptionprotected Threadprotected final longprotected booleanprotected static final org.slf4j.Loggerprotected static final AtomicLongprotected final QueryInfoprotected CloseableIteration<T> protected FedXQueueCursor<T> protected final FederationEvaluationStrategyFields inherited from interface CloseableIteration
EMPTY_STATEMENT_ITERATION -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class ParallelExecutorBase
addResult, checkTimeout, done, getDisplayId, getId, getNextElement, getQueryInfo, handleClose, isFinished, run, toss, toStringModifier and TypeMethodDescriptionvoidaddResult(CloseableIteration<T> res) Handle the result appropriately, e.g. add it to the result iteration.protected voidChecks whether the query execution has run into a timeout.voiddone()Inform the controlling instance that some job is done from a different thread.protected StringgetId()Gets the next element.Return the query info of the associated queryvoidCalled byAbstractCloseableIteration.close()when it is called for the first time.booleanReturn true if this executor is finished or abortedfinal voidrun()voidToss some exception to the controlling instancetoString()Methods inherited from class LookAheadIteration
hasNext, next, removeModifier and TypeMethodDescriptionfinal booleanhasNext()final Tnext()voidremove()Throws anUnsupportedOperationException.Methods inherited from class AbstractCloseableIteration
close, isClosedModifier and TypeMethodDescriptionfinal voidclose()CallsAbstractCloseableIteration.handleClose()upon first call and makes sure the resource closures are only executed once.final booleanisClosed()Checks whether this CloseableIteration has been closed.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface CloseableIteration
streamMethods inherited from interface Iterator
forEachRemaining
-
Constructor Details
-
UnionExecutorBase
-
-
Method Details
-
performExecution
Description copied from class:ParallelExecutorBasePerform the parallel execution.Note that this method must block until the execution is completed.
- Specified by:
performExecutionin classParallelExecutorBase<T>- Throws:
Exception
-
union
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
- Overrides:
getExecutorTypein classParallelExecutorBase<T>- Returns:
- the executor type, e.g. "Join". Default "Executor"
-