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 |
protected boolean |
finished |
protected CloseableIteration<T,QueryEvaluationException> |
leftIter |
protected static int |
NEXT_JOIN_ID |
protected TupleExpr |
rightArg |
protected CloseableIteration<T,QueryEvaluationException> |
rightIter |
protected QueueCursor<CloseableIteration<T,QueryEvaluationException>> |
rightQueue |
Constructor and Description |
---|
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
CloseableIterationBase.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 CloseableIteration<T,QueryEvaluationException> leftIter
protected CloseableIteration<T,QueryEvaluationException> rightIter
protected volatile boolean closed
protected boolean finished
protected final QueueCursor<CloseableIteration<T,QueryEvaluationException>> rightQueue
public 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
CloseableIterationBase
CloseableIterationBase.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 © 2001-2016 Aduna. All Rights Reserved.