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
FieldsModifier and TypeFieldDescriptionprotected final BindingSetprotected booleanDeprecated.protected booleanDeprecated.UseisFinished()instead.protected final CloseableIteration<T,QueryEvaluationException> protected static intDeprecated.No replacement, don't use static shared int variables.protected final TupleExprprotected CloseableIteration<T,QueryEvaluationException> protected final QueueCursor<CloseableIteration<T,QueryEvaluationException>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJoinExecutorBase(CloseableIteration<T, QueryEvaluationException> leftIter, TupleExpr rightArg, BindingSet bindings) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddone()Gets the next element.protected abstract voidImplementations must implement this method to handle bindings.voidCalled byAbstractCloseableIteration.close()when it is called for the first time.booleanGets whether this executor is finished or aborted.final voidrun()voidMethods inherited from class org.eclipse.rdf4j.common.iteration.LookAheadIteration
hasNext, next, removeMethods inherited from class org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration
close, isClosedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.rdf4j.common.iteration.CloseableIteration
stream
-
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:LookAheadIterationGets the next element. Subclasses should implement this method so that it returns the next element.- Specified by:
getNextElementin classLookAheadIteration<T,QueryEvaluationException> - Returns:
- The next element, or null if no more elements are available.
- Throws:
QueryEvaluationException
-
handleClose
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 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.