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, remove
close, isClosed
protected 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
QueryEvaluationException
protected abstract void performExecution() throws Exception
Exception
public void addResult(CloseableIteration<T,QueryEvaluationException> res)
ParallelExecutor
addResult
in interface ParallelExecutor<T>
public void done()
ParallelExecutor
done
in interface ParallelExecutor<T>
public void toss(Exception e)
ParallelExecutor
toss
in interface ParallelExecutor<T>
public T getNextElement() throws QueryEvaluationException
LookAheadIteration
getNextElement
in class LookAheadIteration<T,QueryEvaluationException>
QueryEvaluationException
protected void checkTimeout() throws QueryInterruptedException
QueryInterruptedException
is thrown.QueryInterruptedException
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()
isFinished
in interface ParallelExecutor<T>
public QueryInfo getQueryInfo()
ParallelExecutor
getQueryInfo
in interface ParallelExecutor<T>
protected String getId()
public String getDisplayId()
protected String getExecutorType()
Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.