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 void
addResult(CloseableIteration<BindingSet,QueryEvaluationException> res)
Handle the result appropriately, e.g.void
done()
Inform the controlling instance that some job is done from a different thread.QueryInfo
getQueryInfo()
Return the query info of the associated queryboolean
isFinished()
Return true if this executor is finished or abortedvoid
run()
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.void
toss(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 asOptimizationException
instances.- Parameters:
tasks
-
-
addResult
public void addResult(CloseableIteration<BindingSet,QueryEvaluationException> res)
Description copied from interface:ParallelExecutor
Handle the result appropriately, e.g. add it to the result iteration. Take care for synchronization in a multithreaded environment- Specified by:
addResult
in interfaceParallelExecutor<BindingSet>
-
toss
public void toss(Exception e)
Description copied from interface:ParallelExecutor
Toss some exception to the controlling instance- Specified by:
toss
in interfaceParallelExecutor<BindingSet>
-
done
public void done()
Description copied from interface:ParallelExecutor
Inform the controlling instance that some job is done from a different thread. In most cases this is a no-op.- Specified by:
done
in interfaceParallelExecutor<BindingSet>
-
isFinished
public boolean isFinished()
Description copied from interface:ParallelExecutor
Return true if this executor is finished or aborted- Specified by:
isFinished
in interfaceParallelExecutor<BindingSet>
- Returns:
- whether the execution is finished
-
getQueryInfo
public QueryInfo getQueryInfo()
Description copied from interface:ParallelExecutor
Return the query info of the associated query- Specified by:
getQueryInfo
in interfaceParallelExecutor<BindingSet>
- Returns:
- the query info
-
-