Package org.openspaces.core
Class ExecutorBuilder<T extends Serializable,R>
java.lang.Object
org.openspaces.core.ExecutorBuilder<T,R>
The executor builder allows to combine all the different types of executing tasks into a single
execution (of course, the execution itself, of all the tasks, is asynchronous). Similar to map
reduce where first all the tasks are defined, and then executed, and later on, reduced.
- Author:
- kimchy
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionadd(DistributedTask<T, R> task) Adds a task to be executed similarly toGigaSpace.execute(org.openspaces.core.executor.DistributedTask)add(DistributedTask<T, R> task, Object... routing) Adds a task to be executed similarly toGigaSpace.execute(org.openspaces.core.executor.DistributedTask, Object[])Adds a task to be executed similarly toGigaSpace.execute(org.openspaces.core.executor.Task).add(Task<T> task, AsyncFutureListener<T> listener) Adds a task to be executed similarly toGigaSpace.execute(org.openspaces.core.executor.Task).Adds a task to be executed similarly toGigaSpace.execute(org.openspaces.core.executor.Task, Object).execute()Executes all the given tasks (asynchronously) based on their execution mode and returns a future allowing to retrieve the reduced operation of all the tasks.
-
Method Details
-
add
Adds a task to be executed similarly toGigaSpace.execute(org.openspaces.core.executor.Task).- Parameters:
task- The task to add- Returns:
- The executor builder to add more tasks to or
execute(). - See Also:
-
add
Adds a task to be executed similarly toGigaSpace.execute(org.openspaces.core.executor.Task).- Parameters:
task- The task to add- Returns:
- The executor builder to add more tasks to or
execute(). - See Also:
-
add
Adds a task to be executed similarly toGigaSpace.execute(org.openspaces.core.executor.Task, Object).- Parameters:
task- The task to add- Returns:
- The executor builder to add more tasks to or
execute(). - See Also:
-
add
Adds a task to be executed similarly toGigaSpace.execute(org.openspaces.core.executor.DistributedTask, Object[])- Parameters:
task- The task to add- Returns:
- The executor builder to add more tasks to or
execute(). - See Also:
-
add
Adds a task to be executed similarly toGigaSpace.execute(org.openspaces.core.executor.DistributedTask)- Parameters:
task- The task to add- Returns:
- The executor builder to add more tasks to or
execute(). - See Also:
-
execute
Executes all the given tasks (asynchronously) based on their execution mode and returns a future allowing to retrieve the reduced operation of all the tasks.The future actual result will be the reduced result of the execution, or the exception thrown during during the reduce operation. The moderator (assuming the reducer provided implements
AsyncResultFilter) can be used as a mechanism to listen for results as they arrive.- Returns:
- a Future representing pending completion of the task, and whose
get()method will return the task value upon completion.
-