Class SourceSelection.SourceSelectionExecutorWithLatch
- java.lang.Object
-
- org.eclipse.rdf4j.federated.optimizer.SourceSelection.SourceSelectionExecutorWithLatch
-
- All Implemented Interfaces:
Runnable,ParallelExecutor<BindingSet>
- Enclosing class:
- SourceSelection
protected static class SourceSelection.SourceSelectionExecutorWithLatch extends Object implements ParallelExecutor<BindingSet>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddResult(CloseableIteration<BindingSet,QueryEvaluationException> res)Handle the result appropriately, e.g.voiddone()Inform the controlling instance that some job is done from a different thread.QueryInfogetQueryInfo()Return the query info of the associated querybooleanisFinished()Return true if this executor is finished or abortedvoidrun()static voidrun(SourceSelection sourceSelection, List<SourceSelection.CheckTaskPair> tasks, SourceSelectionCache cache)Execute the given list of tasks in parallel, and block the thread until all tasks are completed.voidtoss(Exception e)Toss some exception to the controlling instance
-
-
-
Method Detail
-
run
public static void run(SourceSelection sourceSelection, List<SourceSelection.CheckTaskPair> tasks, SourceSelectionCache cache)
Execute the given list of tasks in parallel, and block the thread until all tasks are completed. Synchronization is achieved by means of a latch. Results are added to the map of the source selection instance. Errors are reported asOptimizationExceptioninstances.- Parameters:
tasks-
-
addResult
public void addResult(CloseableIteration<BindingSet,QueryEvaluationException> res)
Description copied from interface:ParallelExecutorHandle the result appropriately, e.g. add it to the result iteration. Take care for synchronization in a multithreaded environment- Specified by:
addResultin interfaceParallelExecutor<BindingSet>
-
toss
public void toss(Exception e)
Description copied from interface:ParallelExecutorToss some exception to the controlling instance- Specified by:
tossin interfaceParallelExecutor<BindingSet>
-
done
public void done()
Description copied from interface:ParallelExecutorInform the controlling instance that some job is done from a different thread. In most cases this is a no-op.- Specified by:
donein interfaceParallelExecutor<BindingSet>
-
isFinished
public boolean isFinished()
Description copied from interface:ParallelExecutorReturn true if this executor is finished or aborted- Specified by:
isFinishedin interfaceParallelExecutor<BindingSet>- Returns:
- whether the execution is finished
-
getQueryInfo
public QueryInfo getQueryInfo()
Description copied from interface:ParallelExecutorReturn the query info of the associated query- Specified by:
getQueryInfoin interfaceParallelExecutor<BindingSet>- Returns:
- the query info
-
-