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() |
protected abstract void |
handleBindings()
Implementations must implement this method to handle bindings.
|
void |
handleClose() |
boolean |
isFinished()
Gets whether this executor is finished or aborted.
|
void |
run() |
void |
toss(Exception e) |
hasNext, next, removeclose, isClosedprotected 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
QueryEvaluationExceptionpublic 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 rightQueueExceptionpublic void addResult(CloseableIteration<T,QueryEvaluationException> res)
public void done()
public void toss(Exception e)
public T getNextElement() throws QueryEvaluationException
getNextElement in class LookAheadIteration<T,QueryEvaluationException>QueryEvaluationExceptionpublic void handleClose()
throws QueryEvaluationException
handleClose in class LookAheadIteration<T,QueryEvaluationException>QueryEvaluationExceptionpublic boolean isFinished()
Copyright © 2001-2015 Aduna. All Rights Reserved.