Class ControlledWorkerBoundJoin
java.lang.Object
org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<BindingSet>
org.eclipse.rdf4j.common.iteration.LookAheadIteration<BindingSet>
org.eclipse.rdf4j.federated.evaluation.concurrent.ParallelExecutorBase<BindingSet>
org.eclipse.rdf4j.federated.evaluation.join.JoinExecutorBase<BindingSet>
org.eclipse.rdf4j.federated.evaluation.join.ControlledWorkerJoin
org.eclipse.rdf4j.federated.evaluation.join.ControlledWorkerBoundJoin
- All Implemented Interfaces:
AutoCloseable, Runnable, Iterator<BindingSet>, CloseableIteration<BindingSet>, ParallelExecutor<BindingSet>
Deprecated, for removal: This API element is subject to removal in a future version.
Execute the nested loop join in an asynchronous fashion, using grouped requests, i.e. group bindings into one SPARQL
request using a VALUES clause.
The number of concurrent threads is controlled by a
ControlledWorkerScheduler which works according to the
FIFO principle and uses worker threads.
This join cursor blocks until all scheduled tasks are finished, however the result iteration can be accessed from
different threads to allow for pipelining.- Author:
- Andreas Schwarte
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classDeprecated, for removal: This API element is subject to removal in a future version.protected classDeprecated, for removal: This API element is subject to removal in a future version.protected classDeprecated, for removal: This API element is subject to removal in a future version.protected static interfaceDeprecated, for removal: This API element is subject to removal in a future version. -
Field Summary
Fields inherited from class ControlledWorkerJoin
phaser, schedulerModifier and TypeFieldDescriptionprotected final Phaserprotected final ControlledWorkerScheduler<BindingSet> Fields inherited from class JoinExecutorBase
bindings, joinVars, leftIter, rightArgModifier and TypeFieldDescriptionprotected final BindingSetprotected CloseableIteration<BindingSet> protected final TupleExprFields inherited from class ParallelExecutorBase
evaluationThread, executorId, finished, NEXT_EXECUTOR_ID, queryInfo, rightIter, rightQueue, strategyModifier and TypeFieldDescriptionprotected Threadprotected final longprotected booleanprotected static final AtomicLongprotected final QueryInfoprotected CloseableIteration<BindingSet> protected FedXQueueCursor<BindingSet> protected final FederationEvalStrategyFields inherited from interface CloseableIteration
EMPTY_STATEMENT_ITERATION -
Constructor Summary
ConstructorsConstructorDescriptionControlledWorkerBoundJoin(ControlledWorkerScheduler<BindingSet> scheduler, FederationEvalStrategy strategy, CloseableIteration<BindingSet> leftIter, TupleExpr rightArg, BindingSet bindings, QueryInfo queryInfo) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprotected ControlledWorkerBoundJoin.TaskCreatordetermineTaskCreator(TupleExpr expr, BindingSet bs) Deprecated, for removal: This API element is subject to removal in a future version.protected intgetNextBindJoinSize(int configuredBindJoinSize, int totalBindings) Deprecated, for removal: This API element is subject to removal in a future version.Return the size of the next bind join block.protected voidDeprecated, for removal: This API element is subject to removal in a future version.Implementations must implement this method to handle bindings.voidDeprecated, for removal: This API element is subject to removal in a future version.Called byAbstractCloseableIteration.close()when it is called for the first time.protected voidsetSubmitFirstResultImmediately(boolean flag) Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class JoinExecutorBase
getExecutorType, getJoinVars, performExecution, setJoinVarsModifier and TypeMethodDescriptionprotected Stringprotected final voidPerform the parallel execution.voidsetJoinVars(Set<String> joinVars) Set the join variablesMethods inherited from class ParallelExecutorBase
addResult, checkTimeout, done, getDisplayId, getId, getNextElement, getQueryInfo, isFinished, run, toss, toStringModifier and TypeMethodDescriptionvoidHandle 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 querybooleanReturn 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 BindingSetnext()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
streamModifier and TypeMethodDescriptiondefault Stream<BindingSet> stream()Convert the results to a Java 8 Stream.Methods inherited from interface Iterator
forEachRemaining
-
Constructor Details
-
ControlledWorkerBoundJoin
public ControlledWorkerBoundJoin(ControlledWorkerScheduler<BindingSet> scheduler, FederationEvalStrategy strategy, CloseableIteration<BindingSet> leftIter, TupleExpr rightArg, BindingSet bindings, QueryInfo queryInfo) throws QueryEvaluationException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
QueryEvaluationException
-
-
Method Details
-
setSubmitFirstResultImmediately
protected void setSubmitFirstResultImmediately(boolean flag) Deprecated, for removal: This API element is subject to removal in a future version. -
handleBindings
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:JoinExecutorBaseImplementations must implement this method to handle bindings. Use the following as a templatewhile (!closed invalid input: '&'invalid input: '&' 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.- Overrides:
handleBindingsin classControlledWorkerJoin- Throws:
Exception
-
handleClose
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractCloseableIterationCalled byAbstractCloseableIteration.close()when it is called for the first time. This method is only called once on each iteration. By default, this method does nothing.- Overrides:
handleClosein classControlledWorkerJoin- Throws:
QueryEvaluationException
-
determineTaskCreator
Deprecated, for removal: This API element is subject to removal in a future version. -
getNextBindJoinSize
protected int getNextBindJoinSize(int configuredBindJoinSize, int totalBindings) Deprecated, for removal: This API element is subject to removal in a future version.Return the size of the next bind join block.- Parameters:
configuredBindJoinSize- the configured bind join sizetotalBindings- the current process bindings from the intermediate result set- Returns:
-
ControlledWorkerBindJoinl