com.hazelcast.core
Interface IExecutorService

All Superinterfaces:
DistributedObject, Executor, ExecutorService
All Known Implementing Classes:
ClientExecutorServiceProxy, ExecutorServiceProxy

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 a task on a randomly selected member.
 void executeOnAllMembers(Runnable command)
          Executes a task on all of the known cluster members.
 void executeOnKeyOwner(Runnable command, Object key)
          Executes a task on the owner of the specified key.
 void executeOnMember(Runnable command, Member member)
          Executes a task on the specified member.
 void executeOnMembers(Runnable command, Collection<Member> members)
          Executes a task on each of the specified members.
 void executeOnMembers(Runnable command, MemberSelector memberSelector)
          Executes a 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 a task to a random member.
<T> Future<T>
submit(Callable<T> task, MemberSelector memberSelector)
          Submits a 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.
<T> void
submit(Runnable task, ExecutionCallback<T> callback)
          Submits a task to a random member.
<T> void
submit(Runnable task, MemberSelector memberSelector, ExecutionCallback<T> callback)
          Submits a task to randomly selected members.
<T> Map<Member,Future<T>>
submitToAllMembers(Callable<T> task)
          Submits task to all cluster members and returns a 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 all the cluster members.
 void submitToAllMembers(Runnable task, MultiExecutionCallback callback)
          Submits task to all the cluster members.
<T> Future<T>
submitToKeyOwner(Callable<T> task, Object key)
          Submits a task to the 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 the owner of the specified key.
<T> void
submitToKeyOwner(Runnable task, Object key, ExecutionCallback<T> callback)
          Submits a task to the owner of the specified key.
<T> Future<T>
submitToMember(Callable<T> task, Member member)
          Submits a task to the specified member and returns a Future representing that task.
<T> void
submitToMember(Callable<T> task, Member member, ExecutionCallback<T> callback)
          Submits a task to the specified member.
<T> void
submitToMember(Runnable task, Member member, ExecutionCallback<T> callback)
          Submits a task to the specified member.
<T> Map<Member,Future<T>>
submitToMembers(Callable<T> task, Collection<Member> members)
          Submits a 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 a task to the specified members.
<T> Map<Member,Future<T>>
submitToMembers(Callable<T> task, MemberSelector memberSelector)
          Submits a task to selected members and returns a 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 a 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 a task on a randomly selected member.

Parameters:
command - the task that is executed on a randomly selected member
memberSelector - memberSelector
Throws:
RejectedExecutionException - if no member is selected

executeOnKeyOwner

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

Parameters:
command - a task executed on the owner of the specified key
key - the specified key

executeOnMember

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

Parameters:
command - the task executed on the specified member
member - the specified member

executeOnMembers

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

Parameters:
command - the task executed on the specified members
members - the specified members

executeOnMembers

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

Parameters:
command - a task executed on each of the selected members
memberSelector - memberSelector
Throws:
RejectedExecutionException - if no member is selected

executeOnAllMembers

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

Parameters:
command - a task executed on all of the known cluster members

submit

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

Parameters:
task - task submitted to a randomly selected member
memberSelector - memberSelector
Returns:
a Future representing pending completion of the task
Throws:
RejectedExecutionException - if no member is selected

submitToKeyOwner

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

Parameters:
task - task submitted to the owner of the specified key
key - the specified key
Returns:
a Future representing pending completion of the task

submitToMember

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

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

submitToMembers

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

Parameters:
task - the task submitted to given members
members - the given 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 a task to selected members and returns a map of Member-Future pairs representing pending completion of the task on each member.

Parameters:
task - the task submitted to selected members
memberSelector - memberSelector
Returns:
map of Member-Future pairs representing pending completion of the task on each member
Throws:
RejectedExecutionException - if no member is selected

submitToAllMembers

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

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

submit

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

Parameters:
task - a task submitted to a random member
callback - callback

submit

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

Parameters:
task - the task submitted to randomly selected members
memberSelector - memberSelector
callback - callback
Throws:
RejectedExecutionException - if no member is selected

submitToKeyOwner

<T> void submitToKeyOwner(Runnable task,
                          Object key,
                          ExecutionCallback<T> callback)
Submits a task to the 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 submitted to the owner of the specified key
key - the specified key
callback - callback

submitToMember

<T> void submitToMember(Runnable task,
                        Member member,
                        ExecutionCallback<T> callback)
Submits a 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 - the task submitted to the specified member
member - the specified member
callback - callback

submitToMembers

void submitToMembers(Runnable task,
                     Collection<Member> members,
                     MultiExecutionCallback callback)
Submits a 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 - the task submitted to the specified members
members - the specified 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 - the task submitted to the selected members
memberSelector - memberSelector
callback - callback
Throws:
RejectedExecutionException - if no member is selected

submitToAllMembers

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

Parameters:
task - the task submitted to all the cluster members
callback - callback

submit

<T> void submit(Callable<T> task,
                ExecutionCallback<T> callback)
Submits a 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 - the task submitted to a random member
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 - the task submitted to a randomly selected member
memberSelector - memberSelector
callback - callback
Throws:
RejectedExecutionException - if no member is selected

submitToKeyOwner

<T> void submitToKeyOwner(Callable<T> task,
                          Object key,
                          ExecutionCallback<T> callback)
Submits task to the 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 - the task submitted to the owner of the specified key
callback - callback

submitToMember

<T> void submitToMember(Callable<T> task,
                        Member member,
                        ExecutionCallback<T> callback)
Submits a 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 - the task submitted to the specified member
callback - callback

submitToMembers

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

Parameters:
task - the task submitted to the specified members
members - the specified 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 each task by MultiExecutionCallback.onResponse(Member, Object), and when all tasks are completed, MultiExecutionCallback.onComplete(java.util.Map) will be called.

Parameters:
task - the task submitted to the selected members
memberSelector - memberSelector
callback - callback
Throws:
RejectedExecutionException - if no member is selected

submitToAllMembers

<T> void submitToAllMembers(Callable<T> task,
                            MultiExecutionCallback callback)
Submits task to all the 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 - the task submitted to all the cluster members
callback - callback

getLocalExecutorStats

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

Returns:
local statistics related to this executor service


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