public abstract class JoinExecutorBase<T> extends LookAheadIteration<T,QueryEvaluationException>
LookAheadIteration
and thus any
implementation of this class is applicable for pipelining when used in a different thread (access to shared variables
is synchronized).Modifier and Type | Field and Description |
---|---|
protected BindingSet |
bindings |
protected boolean |
closed
Deprecated.
Use
AbstractCloseableIteration.isClosed() instead. |
protected boolean |
finished
Deprecated.
Use
isFinished() instead. |
protected CloseableIteration<T,QueryEvaluationException> |
leftIter |
protected static int |
NEXT_JOIN_ID
Deprecated.
No replacement, don't use static shared int variables.
|
protected TupleExpr |
rightArg |
protected CloseableIteration<T,QueryEvaluationException> |
rightIter |
protected QueueCursor<CloseableIteration<T,QueryEvaluationException>> |
rightQueue |
Modifier | Constructor and Description |
---|---|
protected |
JoinExecutorBase(CloseableIteration<T,QueryEvaluationException> leftIter,
TupleExpr rightArg,
BindingSet bindings) |
Modifier and Type | Method and Description |
---|---|
void |
addResult(CloseableIteration<T,QueryEvaluationException> res) |
void |
done() |
T |
getNextElement()
Gets the next element.
|
protected abstract void |
handleBindings()
Implementations must implement this method to handle bindings.
|
void |
handleClose()
Called by
AbstractCloseableIteration.close() when it is called for the first time. |
boolean |
isFinished()
Gets whether this executor is finished or aborted.
|
void |
run() |
void |
toss(Exception e) |
hasNext, next, remove
close, isClosed
protected static int NEXT_JOIN_ID
protected final TupleExpr rightArg
protected final BindingSet bindings
protected final CloseableIteration<T,QueryEvaluationException> leftIter
protected volatile CloseableIteration<T,QueryEvaluationException> rightIter
protected volatile boolean closed
AbstractCloseableIteration.isClosed()
instead.protected volatile boolean finished
isFinished()
instead.protected final QueueCursor<CloseableIteration<T,QueryEvaluationException>> rightQueue
protected JoinExecutorBase(CloseableIteration<T,QueryEvaluationException> leftIter, TupleExpr rightArg, BindingSet bindings) throws QueryEvaluationException
QueryEvaluationException
public final void run()
protected abstract void handleBindings() throws Exception
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 rightQueueException
public void addResult(CloseableIteration<T,QueryEvaluationException> res)
public void done()
public void toss(Exception e)
public T getNextElement() throws QueryEvaluationException
LookAheadIteration
getNextElement
in class LookAheadIteration<T,QueryEvaluationException>
QueryEvaluationException
public void handleClose() throws QueryEvaluationException
AbstractCloseableIteration
AbstractCloseableIteration.close()
when it is called for the first time. This method is only called once on each iteration.
By default, this method does nothing.handleClose
in class LookAheadIteration<T,QueryEvaluationException>
QueryEvaluationException
public boolean isFinished()
Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.