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>
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Handle the result appropriately, e.g.void
done()
Inform the controlling instance that some job is done from a different thread.Return the query info of the associated queryboolean
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 some exception to the controlling instance
-
Field Details
-
errors
-
-
Method Details
-
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
-
-
run
public void run() -
addResult
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
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
Description copied from interface:ParallelExecutor
Return the query info of the associated query- Specified by:
getQueryInfo
in interfaceParallelExecutor<BindingSet>
- Returns:
- the query info
-