java.lang.Object
org.apache.lucene.search.TaskExecutor.TaskGroup<T>
- Type Parameters:
T
- the return type of all the callables
- Enclosing class:
TaskExecutor
Holds all the sub-tasks that a certain operation gets split into as it gets parallelized and
exposes the ability to invoke such tasks and wait for them all to complete their execution and
provide their results. Additionally, if one task throws an exception, all other tasks from the
same group are cancelled, to avoid needless computation as their results would not be exposed
anyways. Creates one
FutureTask
for each Callable
provided-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
private void
(package private) RunnableFuture
<T> createTask
(Callable<T> callable)
-
Field Details
-
futures
-
-
Constructor Details
-
TaskGroup
TaskGroup(Collection<Callable<T>> callables)
-
-
Method Details
-
createTask
-
invokeAll
- Throws:
IOException
-
assertAllFuturesCompleted
private boolean assertAllFuturesCompleted() -
cancelAll
private void cancelAll()
-