com.hazelcast.core
Interface IExecutorService

All Superinterfaces:
DistributedObject, Executor, ExecutorService

public interface IExecutorService
extends ExecutorService, DistributedObject

Distributed implementation of ExecutorService. IExecutorService provides additional methods like executing tasks on a specific member, on a member who is owner of a specific key, executing a tasks on multiple members and listening execution result using a callback.

See Also:
ExecutorService, ExecutionCallback, MultiExecutionCallback

Method Summary
 void execute(Runnable command, MemberSelector memberSelector)
          Executes task on a randomly selected member
 void executeOnAllMembers(Runnable command)
          Executes task on all of known cluster members
 void executeOnKeyOwner(Runnable command, Object key)
          Executes task on owner of the specified key
 void executeOnMember(Runnable command, Member member)
          Executes task on the specified member
 void executeOnMembers(Runnable command, Collection<Member> members)
          Executes task on each of the specified members
 void executeOnMembers(Runnable command, MemberSelector memberSelector)
          Executes task on each of the selected members
 LocalExecutorStats getLocalExecutorStats()
          Returns local statistics related to this executor service.
<T> void
submit(Callable<T> task, ExecutionCallback<T> callback)
          Submits task to a random member.
<T> Future<T>
submit(Callable<T> task, MemberSelector memberSelector)
          Submits task to a randomly selected member and returns a Future representing that task.
<T> void
submit(Callable<T> task, MemberSelector memberSelector, ExecutionCallback<T> callback)
          Submits task to a randomly selected member.
 void submit(Runnable task, ExecutionCallback callback)
          Submits task to a random member.
 void submit(Runnable task, MemberSelector memberSelector, ExecutionCallback callback)
          Submits task to a randomly selected members.
<T> Map<Member,Future<T>>
submitToAllMembers(Callable<T> task)
          Submits task to all cluster members and returns map of Member-Future pairs representing pending completion of the task on each member
<T> void
submitToAllMembers(Callable<T> task, MultiExecutionCallback callback)
          Submits task to the all cluster members.
 void submitToAllMembers(Runnable task, MultiExecutionCallback callback)
          Submits task to the all cluster members.
<T> Future<T>
submitToKeyOwner(Callable<T> task, Object key)
          Submits task to owner of the specified key and returns a Future representing that task.
<T> void
submitToKeyOwner(Callable<T> task, Object key, ExecutionCallback<T> callback)
          Submits task to owner of the specified key.
 void submitToKeyOwner(Runnable task, Object key, ExecutionCallback callback)
          Submits task to owner of the specified key.
<T> Future<T>
submitToMember(Callable<T> task, Member member)
          Submits task to specified member and returns a Future representing that task.
<T> void
submitToMember(Callable<T> task, Member member, ExecutionCallback<T> callback)
          Submits task to the specified member.
 void submitToMember(Runnable task, Member member, ExecutionCallback callback)
          Submits task to the specified member.
<T> Map<Member,Future<T>>
submitToMembers(Callable<T> task, Collection<Member> members)
          Submits task to given members and returns map of Member-Future pairs representing pending completion of the task on each member
<T> void
submitToMembers(Callable<T> task, Collection<Member> members, MultiExecutionCallback callback)
          Submits task to the specified members.
<T> Map<Member,Future<T>>
submitToMembers(Callable<T> task, MemberSelector memberSelector)
          Submits task to selected members and returns map of Member-Future pairs representing pending completion of the task on each member
<T> void
submitToMembers(Callable<T> task, MemberSelector memberSelector, MultiExecutionCallback callback)
          Submits task to the selected members.
 void submitToMembers(Runnable task, Collection<Member> members, MultiExecutionCallback callback)
          Submits task to the specified members.
 void submitToMembers(Runnable task, MemberSelector memberSelector, MultiExecutionCallback callback)
          Submits task to the selected members.
 
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit
 
Methods inherited from interface java.util.concurrent.Executor
execute
 
Methods inherited from interface com.hazelcast.core.DistributedObject
destroy, getId, getName, getPartitionKey, getServiceName
 

Method Detail

execute

void execute(Runnable command,
             MemberSelector memberSelector)
Executes task on a randomly selected member

Parameters:
command - task
memberSelector - memberSelector

executeOnKeyOwner

void executeOnKeyOwner(Runnable command,
                       Object key)
Executes task on owner of the specified key

Parameters:
command - task
key - key

executeOnMember

void executeOnMember(Runnable command,
                     Member member)
Executes task on the specified member

Parameters:
command - task
member - member

executeOnMembers

void executeOnMembers(Runnable command,
                      Collection<Member> members)
Executes task on each of the specified members

Parameters:
command - task
members - members

executeOnMembers

void executeOnMembers(Runnable command,
                      MemberSelector memberSelector)
Executes task on each of the selected members

Parameters:
command - task
memberSelector - memberSelector

executeOnAllMembers

void executeOnAllMembers(Runnable command)
Executes task on all of known cluster members

Parameters:
command - task

submit

<T> Future<T> submit(Callable<T> task,
                     MemberSelector memberSelector)
Submits task to a randomly selected member and returns a Future representing that task.

Parameters:
task - task
memberSelector - memberSelector
Returns:
a Future representing pending completion of the task

submitToKeyOwner

<T> Future<T> submitToKeyOwner(Callable<T> task,
                               Object key)
Submits task to owner of the specified key and returns a Future representing that task.

Parameters:
task - task
key - key
Returns:
a Future representing pending completion of the task

submitToMember

<T> Future<T> submitToMember(Callable<T> task,
                             Member member)
Submits task to specified member and returns a Future representing that task.

Parameters:
task - task
member - member
Returns:
a Future representing pending completion of the task

submitToMembers

<T> Map<Member,Future<T>> submitToMembers(Callable<T> task,
                                          Collection<Member> members)
Submits task to given members and returns map of Member-Future pairs representing pending completion of the task on each member

Parameters:
task - task
members - members
Returns:
map of Member-Future pairs representing pending completion of the task on each member

submitToMembers

<T> Map<Member,Future<T>> submitToMembers(Callable<T> task,
                                          MemberSelector memberSelector)
Submits task to selected members and returns map of Member-Future pairs representing pending completion of the task on each member

Parameters:
task - task
memberSelector - memberSelector
Returns:
map of Member-Future pairs representing pending completion of the task on each member

submitToAllMembers

<T> Map<Member,Future<T>> submitToAllMembers(Callable<T> task)
Submits task to all cluster members and returns map of Member-Future pairs representing pending completion of the task on each member

Parameters:
task - task
Returns:
map of Member-Future pairs representing pending completion of the task on each member

submit

void submit(Runnable task,
            ExecutionCallback callback)
Submits task to a random member. Caller will be notified for the result of the task by ExecutionCallback.onResponse(Object) or ExecutionCallback.onFailure(Throwable).

Parameters:
task - task
callback - callback

submit

void submit(Runnable task,
            MemberSelector memberSelector,
            ExecutionCallback callback)
Submits task to a randomly selected members. Caller will be notified for the result of the task by ExecutionCallback.onResponse(Object) or ExecutionCallback.onFailure(Throwable).

Parameters:
task - task
memberSelector - memberSelector
callback - callback

submitToKeyOwner

void submitToKeyOwner(Runnable task,
                      Object key,
                      ExecutionCallback callback)
Submits task to owner of the specified key. Caller will be notified for the result of the task by ExecutionCallback.onResponse(Object) or ExecutionCallback.onFailure(Throwable).

Parameters:
task - task
callback - callback

submitToMember

void submitToMember(Runnable task,
                    Member member,
                    ExecutionCallback callback)
Submits task to the specified member. Caller will be notified for the result of the task by ExecutionCallback.onResponse(Object) or ExecutionCallback.onFailure(Throwable).

Parameters:
task - task
callback - callback

submitToMembers

void submitToMembers(Runnable task,
                     Collection<Member> members,
                     MultiExecutionCallback callback)
Submits task to the specified members. Caller will be notified for the result of the each task by MultiExecutionCallback.onResponse(Member, Object), and when all tasks are completed, MultiExecutionCallback.onComplete(java.util.Map) will be called.

Parameters:
task - task
members - members
callback - callback

submitToMembers

void submitToMembers(Runnable task,
                     MemberSelector memberSelector,
                     MultiExecutionCallback callback)
Submits task to the selected members. Caller will be notified for the result of the each task by MultiExecutionCallback.onResponse(Member, Object), and when all tasks are completed, MultiExecutionCallback.onComplete(java.util.Map) will be called.

Parameters:
task - task
memberSelector - memberSelector
callback - callback

submitToAllMembers

void submitToAllMembers(Runnable task,
                        MultiExecutionCallback callback)
Submits task to the all cluster members. Caller will be notified for the result of the each task by MultiExecutionCallback.onResponse(Member, Object), and when all tasks are completed, MultiExecutionCallback.onComplete(java.util.Map) will be called.

Parameters:
task - task
callback - callback

submit

<T> void submit(Callable<T> task,
                ExecutionCallback<T> callback)
Submits task to a random member. Caller will be notified for the result of the task by ExecutionCallback.onResponse(Object) or ExecutionCallback.onFailure(Throwable).

Parameters:
task - task
callback - callback

submit

<T> void submit(Callable<T> task,
                MemberSelector memberSelector,
                ExecutionCallback<T> callback)
Submits task to a randomly selected member. Caller will be notified for the result of the task by ExecutionCallback.onResponse(Object) or ExecutionCallback.onFailure(Throwable).

Parameters:
task - task
memberSelector - memberSelector
callback - callback

submitToKeyOwner

<T> void submitToKeyOwner(Callable<T> task,
                          Object key,
                          ExecutionCallback<T> callback)
Submits task to owner of the specified key. Caller will be notified for the result of the task by ExecutionCallback.onResponse(Object) or ExecutionCallback.onFailure(Throwable).

Parameters:
task - task
callback - callback

submitToMember

<T> void submitToMember(Callable<T> task,
                        Member member,
                        ExecutionCallback<T> callback)
Submits task to the specified member. Caller will be notified for the result of the task by ExecutionCallback.onResponse(Object) or ExecutionCallback.onFailure(Throwable).

Parameters:
task - task
callback - callback

submitToMembers

<T> void submitToMembers(Callable<T> task,
                         Collection<Member> members,
                         MultiExecutionCallback callback)
Submits task to the specified members. Caller will be notified for the result of the each task by MultiExecutionCallback.onResponse(Member, Object), and when all tasks are completed, MultiExecutionCallback.onComplete(java.util.Map) will be called.

Parameters:
task - task
members - members
callback - callback

submitToMembers

<T> void submitToMembers(Callable<T> task,
                         MemberSelector memberSelector,
                         MultiExecutionCallback callback)
Submits task to the selected members. Caller will be notified for the result of the each task by MultiExecutionCallback.onResponse(Member, Object), and when all tasks are completed, MultiExecutionCallback.onComplete(java.util.Map) will be called.

Parameters:
task - task
memberSelector - memberSelector
callback - callback

submitToAllMembers

<T> void submitToAllMembers(Callable<T> task,
                            MultiExecutionCallback callback)
Submits task to the all cluster members. Caller will be notified for the result of the each task by MultiExecutionCallback.onResponse(Member, Object), and when all tasks are completed, MultiExecutionCallback.onComplete(java.util.Map) will be called.

Parameters:
task - task
callback - callback

getLocalExecutorStats

LocalExecutorStats getLocalExecutorStats()
Returns local statistics related to this executor service.

Returns:
local statistics related to this executor service.


Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.