Hazelcast C++ Client
|
Distributed implementation of java.util.concurrent.ExecutorService. More...
#include <IExecutorService.h>
Public Member Functions | |
template<typename HazelcastSerializable > | |
void | execute (const HazelcastSerializable &command) |
Executes the given command at some time in the future. More... | |
template<typename HazelcastSerializable > | |
void | execute (const HazelcastSerializable &command, const cluster::memberselector::MemberSelector &memberSelector) |
Executes a task on a randomly selected member. More... | |
template<typename HazelcastSerializable , typename K > | |
void | executeOnKeyOwner (const HazelcastSerializable &command, const K &key) |
Executes a task on the owner of the specified key. More... | |
template<typename HazelcastSerializable > | |
void | executeOnMember (const HazelcastSerializable &command, const Member &member) |
Executes a task on the specified member. More... | |
template<typename HazelcastSerializable > | |
void | executeOnMembers (const HazelcastSerializable &command, const std::vector< Member > &members) |
Executes a task on each of the specified members. More... | |
template<typename HazelcastSerializable > | |
void | executeOnMembers (const HazelcastSerializable &command, const cluster::memberselector::MemberSelector &memberSelector) |
Executes a task on each of the selected members. More... | |
template<typename HazelcastSerializable > | |
void | executeOnAllMembers (const HazelcastSerializable &command) |
Executes a task on all of the known cluster members. More... | |
template<typename HazelcastSerializable , typename T , typename K > | |
boost::shared_ptr< ICompletableFuture< T > > | submitToKeyOwner (const HazelcastSerializable &task, const K &key) |
Submits a task to the owner of the specified key and returns a ICompletableFuture representing that task. More... | |
template<typename HazelcastSerializable , typename T > | |
boost::shared_ptr< ICompletableFuture< T > > | submitToMember (const HazelcastSerializable &task, const Member &member) |
Submits a task to the specified member and returns a ICompletableFuture representing that task. More... | |
template<typename HazelcastSerializable , typename T > | |
std::map< Member, boost::shared_ptr< ICompletableFuture< T > > > | submitToMembers (const HazelcastSerializable &task, const std::vector< Member > &members) |
Submits a task to given members and returns map of Member-ICompletableFuture pairs representing pending completion of the task on each member. More... | |
template<typename HazelcastSerializable , typename T > | |
std::map< Member, boost::shared_ptr< ICompletableFuture< T > > > | submitToMembers (const HazelcastSerializable &task, const cluster::memberselector::MemberSelector &memberSelector) |
Submits a task to selected members and returns a map of Member-ICompletableFuture pairs representing pending completion of the task on each member. More... | |
template<typename HazelcastSerializable , typename T > | |
std::map< Member, boost::shared_ptr< ICompletableFuture< T > > > | submitToAllMembers (const HazelcastSerializable &task) |
Submits task to all cluster members and returns a map of Member-ICompletableFuture pairs representing pending completion of the task on each member. More... | |
template<typename HazelcastSerializable , typename T > | |
boost::shared_ptr< ICompletableFuture< T > > | submit (const HazelcastSerializable &task, const boost::shared_ptr< T > &result) |
Submits a task for execution and returns a ICompletableFuture representing that task. More... | |
template<typename HazelcastSerializable , typename T > | |
boost::shared_ptr< ICompletableFuture< T > > | submit (const HazelcastSerializable &task) |
Submits a value-returning task for execution and returns a ICompletableFuture representing the pending results of the task. More... | |
template<typename HazelcastSerializable , typename T > | |
void | submit (const HazelcastSerializable &task, const boost::shared_ptr< ExecutionCallback< T > > &callback) |
Submits a task to a random member. More... | |
template<typename HazelcastSerializable , typename T > | |
boost::shared_ptr< ICompletableFuture< T > > | submit (const HazelcastSerializable &task, const cluster::memberselector::MemberSelector &memberSelector) |
Submits a task to a randomly selected member and returns a ICompletableFuture representing that task. More... | |
template<typename HazelcastSerializable , typename T > | |
void | submit (const HazelcastSerializable &task, const cluster::memberselector::MemberSelector &memberSelector, const boost::shared_ptr< ExecutionCallback< T > > &callback) |
Submits a task to randomly selected members. More... | |
template<typename HazelcastSerializable , typename T , typename K > | |
void | submitToKeyOwner (const HazelcastSerializable &task, const K &key, const boost::shared_ptr< ExecutionCallback< T > > &callback) |
Submits a task to the owner of the specified key. More... | |
template<typename HazelcastSerializable , typename T > | |
void | submitToMember (const HazelcastSerializable &task, const Member &member, const boost::shared_ptr< ExecutionCallback< T > > &callback) |
Submits a task to the specified member. More... | |
template<typename HazelcastSerializable , typename T > | |
void | submitToMembers (const HazelcastSerializable &task, const std::vector< Member > &members, const boost::shared_ptr< MultiExecutionCallback< T > > &callback) |
Submits a task to the specified members. More... | |
template<typename HazelcastSerializable , typename T > | |
void | submitToMembers (const HazelcastSerializable &task, const cluster::memberselector::MemberSelector &memberSelector, const boost::shared_ptr< MultiExecutionCallback< T > > &callback) |
Submits task to the selected members. More... | |
template<typename HazelcastSerializable , typename T > | |
void | submitToAllMembers (const HazelcastSerializable &task, const boost::shared_ptr< MultiExecutionCallback< T > > &callback) |
Submits task to all the cluster members. More... | |
void | shutdown () |
Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted. More... | |
bool | isShutdown () |
Returns. More... | |
bool | isTerminated () |
Returns. More... | |
Static Public Attributes | |
static const std::string | SERVICE_NAME = "hz:impl:executorService" |
Friends | |
class | executor::impl::ExecutorServiceProxyFactory |
Distributed implementation of java.util.concurrent.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.
|
inline |
Executes the given command at some time in the future.
The command may execute in a new thread, in a pooled thread, or in the calling thread, at the discretion of the
implementation.
command | the runnable task |
RejectedExecutionException | if this task cannot be accepted for execution |
|
inline |
Executes a task on a randomly selected member.
command | the task that is executed on a randomly selected member |
memberSelector | memberSelector |
RejectedExecutionException | if no member is selected |
|
inline |
Executes a task on all of the known cluster members.
command | a task executed on all of the known cluster members |
|
inline |
Executes a task on the owner of the specified key.
command | a task executed on the owner of the specified key |
key | the specified key |
|
inline |
Executes a task on the specified member.
command | the task executed on the specified member |
member | the specified member |
|
inline |
Executes a task on each of the specified members.
command | the task executed on the specified members |
members | the specified members |
|
inline |
Executes a task on each of the selected members.
command | a task executed on each of the selected members |
memberSelector | memberSelector |
RejectedExecutionException | if no member is selected |
bool hazelcast::client::IExecutorService::isShutdown | ( | ) |
Returns.
if this executor has been shut down.
bool hazelcast::client::IExecutorService::isTerminated | ( | ) |
Returns.
if all tasks have completed following shut down. Note that
is never
unless either
.
void hazelcast::client::IExecutorService::shutdown | ( | ) |
Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.
Invocation has no additional effect if already shut down.
This method does not wait for previously submitted tasks to complete execution.
|
inline |
Submits a task for execution and returns a ICompletableFuture representing that task.
The ICompletableFuture's
method will return the given result upon successful completion.
task | the task to submit |
result | the result to return |
<T> | the type of the result |
RejectedExecutionException | if the task cannot be scheduled for execution |
NullPointerException | if the task is null |
|
inline |
Submits a value-returning task for execution and returns a ICompletableFuture representing the pending results of the task.
The ICompletableFuture's
method will return the task's result upon successful completion.
If you would like to immediately block waiting for a task, you can use constructions of the form
task | the task to submit |
<T> | the type of the task's result |
RejectedExecutionException | if the task cannot be scheduled for execution |
|
inline |
Submits a task to a random member.
Caller will be notified of the result of the task by ExecutionCallback<T>::onResponse() or ExecutionCallback<T>::onFailure(exception::IException).
task | a task submitted to a random member |
callback | callback |
<T> | the response type of callback |
|
inline |
Submits a task to a randomly selected member and returns a ICompletableFuture representing that task.
task | task submitted to a randomly selected member |
memberSelector | memberSelector |
<T> | the result type of callable |
RejectedExecutionException | if no member is selected |
|
inline |
Submits a task to randomly selected members.
Caller will be notified for the result of the task by ExecutionCallback<T>::onResponse() or ExecutionCallback<T>::onFailure(exception::IException).
task | the task submitted to randomly selected members |
memberSelector | memberSelector |
callback | callback |
<T> | the response type of callback |
RejectedExecutionException | if no member is selected |
|
inline |
Submits task to all cluster members and returns a map of Member-ICompletableFuture pairs representing pending completion of the task on each member.
task | the task submitted to all cluster members |
<T> | the result type of callable |
|
inline |
Submits task to all the cluster members.
Caller will be notified for the result of each task by MultiExecutionCallback#onResponse(const Member &, const boost::shared_ptr<V> &), and when all tasks are completed, MultiExecutionCallback#onComplete(std::map) will be called.
task | the task submitted to all the cluster members |
callback | callback |
|
inline |
Submits a task to the owner of the specified key and returns a ICompletableFuture representing that task.
task | task submitted to the owner of the specified key |
key | the specified key |
<T> | the result type of callable |
|
inline |
Submits a task to the owner of the specified key.
Caller will be notified for the result of the task by ExecutionCallback<T>::onResponse() or ExecutionCallback<T>::onFailure(exception::IException).
task | task submitted to the owner of the specified key |
key | the specified key |
callback | callback |
<T> | the response type of callback |
|
inline |
Submits a task to the specified member and returns a ICompletableFuture representing that task.
task | the task submitted to the specified member |
member | the specified member |
<T> | the result type of callable |
|
inline |
Submits a task to the specified member.
Caller will be notified for the result of the task by ExecutionCallback<T>::onResponse() or ExecutionCallback<T>::onFailure(exception::IException).
task | the task submitted to the specified member |
member | the specified member |
callback | callback |
<T> | the response type of callback |
|
inline |
Submits a task to given members and returns map of Member-ICompletableFuture pairs representing pending completion of the task on each member.
task | the task submitted to given members |
members | the given members |
<T> | the result type of callable |
|
inline |
Submits a task to selected members and returns a map of Member-ICompletableFuture pairs representing pending completion of the task on each member.
task | the task submitted to selected members |
memberSelector | memberSelector |
<T> | the result type of callable |
RejectedExecutionException | if no member is selected |
|
inline |
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(std::vector) will be called.
task | the task submitted to the specified members |
members | the specified members |
callback | callback |
|
inline |
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(std::map) will be called.
task | the task submitted to the selected members |
memberSelector | memberSelector |
callback | callback |
RejectedExecutionException | if no member is selected |