public class ControlledWorkerJoin extends JoinExecutorBase<BindingSet>
ControlledWorkerScheduler which works according to the
FIFO principle.
This join cursor blocks until all scheduled tasks are finished, however the result iteration can be accessed from
different threads to allow for pipelining.| Modifier and Type | Field and Description |
|---|---|
protected Phaser |
phaser |
protected ControlledWorkerScheduler<BindingSet> |
scheduler |
bindings, joinVars, leftIter, rightArgclosed, evaluationThread, executorId, finished, NEXT_EXECUTOR_ID, queryInfo, rightIter, rightQueue, strategy| Constructor and Description |
|---|
ControlledWorkerJoin(ControlledWorkerScheduler<BindingSet> scheduler,
FederationEvalStrategy strategy,
CloseableIteration<BindingSet,QueryEvaluationException> leftIter,
TupleExpr rightArg,
BindingSet bindings,
QueryInfo queryInfo) |
| Modifier and Type | Method and Description |
|---|---|
void |
done()
Inform the controlling instance that some job is done from a different thread.
|
protected void |
handleBindings()
Implementations must implement this method to handle bindings.
|
void |
toss(Exception e)
Toss some exception to the controlling instance
|
getExecutorType, getJoinVars, handleClose, performExecution, setJoinVarsaddResult, checkTimeout, getDisplayId, getId, getNextElement, getQueryInfo, isFinished, run, toStringhasNext, next, removeclose, isClosedprotected final ControlledWorkerScheduler<BindingSet> scheduler
protected final Phaser phaser
public ControlledWorkerJoin(ControlledWorkerScheduler<BindingSet> scheduler, FederationEvalStrategy strategy, CloseableIteration<BindingSet,QueryEvaluationException> leftIter, TupleExpr rightArg, BindingSet bindings, QueryInfo queryInfo) throws QueryEvaluationException
QueryEvaluationExceptionprotected void handleBindings()
throws Exception
JoinExecutorBase
while (!closed && leftIter.hasNext()) {
// your code
}
and add results to rightQueue. Note that addResult() is implemented synchronized and thus thread safe. In case
you can guarantee sequential access, it is also possible to directly access rightQueue
Note that the implementation must block until the entire join is executed.handleBindings in class JoinExecutorBase<BindingSet>Exceptionpublic void done()
ParallelExecutordone in interface ParallelExecutor<BindingSet>done in class ParallelExecutorBase<BindingSet>public void toss(Exception e)
ParallelExecutortoss in interface ParallelExecutor<BindingSet>toss in class ParallelExecutorBase<BindingSet>Copyright © 2015-2021 Eclipse Foundation. All Rights Reserved.