T - public abstract class ParallelExecutorBase<T> extends LookAheadIteration<T,QueryEvaluationException> implements ParallelExecutor<T>
JoinExecutorBase and UnionExecutorBase.JoinExecutorBase,
UnionExecutorBase| Modifier and Type | Field and Description |
|---|---|
protected Thread |
evaluationThread |
protected long |
executorId |
protected boolean |
finished |
protected static org.slf4j.Logger |
log |
protected static AtomicLong |
NEXT_EXECUTOR_ID |
protected QueryInfo |
queryInfo |
protected CloseableIteration<T,QueryEvaluationException> |
rightIter |
protected FedXQueueCursor<T> |
rightQueue |
protected FederationEvalStrategy |
strategy |
| Constructor and Description |
|---|
ParallelExecutorBase(FederationEvalStrategy strategy,
QueryInfo queryInfo) |
| Modifier and Type | Method and Description |
|---|---|
void |
addResult(CloseableIteration<T,QueryEvaluationException> res)
Handle the result appropriately, e.g.
|
protected void |
checkTimeout()
Checks whether the query execution has run into a timeout.
|
void |
done()
Inform the controlling instance that some job is done from a different thread.
|
String |
getDisplayId() |
protected String |
getExecutorType() |
protected String |
getId() |
T |
getNextElement()
Gets the next element.
|
QueryInfo |
getQueryInfo()
Return the query info of the associated query
|
void |
handleClose()
Called by
AbstractCloseableIteration.close() when it is called for the first time. |
boolean |
isFinished()
Return true if this executor is finished or aborted
|
protected abstract void |
performExecution()
Perform the parallel execution.
|
void |
run() |
void |
toss(Exception e)
Toss some exception to the controlling instance
|
String |
toString() |
hasNext, next, removeclose, isClosedprotected static final org.slf4j.Logger log
protected static final AtomicLong NEXT_EXECUTOR_ID
protected final FederationEvalStrategy strategy
protected final long executorId
protected final QueryInfo queryInfo
protected volatile Thread evaluationThread
protected FedXQueueCursor<T> rightQueue
protected volatile CloseableIteration<T,QueryEvaluationException> rightIter
protected volatile boolean finished
public ParallelExecutorBase(FederationEvalStrategy strategy, QueryInfo queryInfo) throws QueryEvaluationException
QueryEvaluationExceptionprotected abstract void performExecution()
throws Exception
Exceptionpublic void addResult(CloseableIteration<T,QueryEvaluationException> res)
ParallelExecutoraddResult in interface ParallelExecutor<T>public void done()
ParallelExecutordone in interface ParallelExecutor<T>public void toss(Exception e)
ParallelExecutortoss in interface ParallelExecutor<T>public T getNextElement() throws QueryEvaluationException
LookAheadIterationgetNextElement in class LookAheadIteration<T,QueryEvaluationException>QueryEvaluationExceptionprotected void checkTimeout()
throws QueryInterruptedException
QueryInterruptedException is thrown.QueryInterruptedExceptionpublic void handleClose()
throws QueryEvaluationException
AbstractCloseableIterationAbstractCloseableIteration.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>QueryEvaluationExceptionpublic boolean isFinished()
isFinished in interface ParallelExecutor<T>public QueryInfo getQueryInfo()
ParallelExecutorgetQueryInfo in interface ParallelExecutor<T>protected String getId()
public String getDisplayId()
protected String getExecutorType()
Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.