Class GridWorkerPool
- java.lang.Object
-
- org.apache.ignite.internal.util.worker.GridWorkerPool
-
public class GridWorkerPool extends Object
Pool of runnable workers. This class automatically takes care of error handling that has to do with executing a runnable task and ensures that all tasks are finished when stop occurs.
-
-
Constructor Summary
Constructors Constructor Description GridWorkerPool(Executor exec, IgniteLogger log)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(GridWorker w)Schedules runnable task for execution.voidjoin(boolean cancel)Waits for all workers to finish.
-
-
-
Constructor Detail
-
GridWorkerPool
public GridWorkerPool(Executor exec, IgniteLogger log)
- Parameters:
exec- Executor service.log- Logger to use.
-
-
Method Detail
-
execute
public void execute(GridWorker w) throws IgniteCheckedException
Schedules runnable task for execution.- Parameters:
w- Runnable task.- Throws:
IgniteCheckedException- Thrown if any exception occurred.
-
join
public void join(boolean cancel)
Waits for all workers to finish.- Parameters:
cancel- Flag to indicate whether workers should be cancelled before waiting for them to finish.
-
-