Class JoinExecutorBase<T>
java.lang.Object
org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<E,X>
org.eclipse.rdf4j.common.iteration.LookAheadIteration<T,QueryEvaluationException>
org.eclipse.rdf4j.repository.sparql.federation.JoinExecutorBase<T>
- All Implemented Interfaces:
AutoCloseable
,CloseableIteration<T,
,QueryEvaluationException> Iteration<T,
QueryEvaluationException>
- Direct Known Subclasses:
JoinExecutorBase
Base class for any join parallel join 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
Modifier and TypeFieldDescriptionprotected final BindingSet
protected boolean
Deprecated.protected boolean
Deprecated.UseisFinished()
instead.protected final CloseableIteration<T,
QueryEvaluationException> protected static int
Deprecated.No replacement, don't use static shared int variables.protected final TupleExpr
protected CloseableIteration<T,
QueryEvaluationException> protected final QueueCursor<CloseableIteration<T,
QueryEvaluationException>> -
Constructor Summary
ModifierConstructorDescriptionprotected
JoinExecutorBase
(CloseableIteration<T, QueryEvaluationException> leftIter, TupleExpr rightArg, BindingSet bindings) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
done()
Gets the next element.protected abstract void
Implementations must implement this method to handle bindings.void
Called byAbstractCloseableIteration.close()
when it is called for the first time.boolean
Gets whether this executor is finished or aborted.final void
run()
void
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
-
Field Details
-
NEXT_JOIN_ID
protected static int NEXT_JOIN_IDDeprecated.No replacement, don't use static shared int variables. -
rightArg
-
bindings
-
leftIter
-
rightIter
-
closed
protected volatile boolean closedDeprecated.UseAbstractCloseableIteration.isClosed()
instead. -
finished
protected volatile boolean finishedDeprecated.UseisFinished()
instead. -
rightQueue
-
-
Constructor Details
-
JoinExecutorBase
protected JoinExecutorBase(CloseableIteration<T, QueryEvaluationException> leftIter, TupleExpr rightArg, BindingSet bindings) throws QueryEvaluationException- Throws:
QueryEvaluationException
-
-
Method Details
-
run
public final void run() -
handleBindings
Implementations must implement this method to handle bindings. Use the following as a templatewhile (!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- Throws:
Exception
-
addResult
-
done
public void done() -
toss
-
getNextElement
Description copied from class:LookAheadIteration
Gets the next element. Subclasses should implement this method so that it returns the next element.- Specified by:
getNextElement
in classLookAheadIteration<T,
QueryEvaluationException> - Returns:
- The next element, or null if no more elements are available.
- Throws:
QueryEvaluationException
-
handleClose
Description copied from class:AbstractCloseableIteration
Called 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:
handleClose
in classLookAheadIteration<T,
QueryEvaluationException> - Throws:
QueryEvaluationException
-
isFinished
public boolean isFinished()Gets whether this executor is finished or aborted.- Returns:
- true if this executor is finished or aborted
-
AbstractCloseableIteration.isClosed()
instead.