public interface OperationService
run(Operation)
and execute(Operation)
. Or it can executed remotely using one of
the send methods.
It also is possible to execute multiple operation on multiple partitions
using one of the invoke methods.Modifier and Type | Method and Description |
---|---|
InvocationBuilder |
createInvocationBuilder(String serviceName,
Operation op,
Address target) |
InvocationBuilder |
createInvocationBuilder(String serviceName,
Operation op,
int partitionId) |
void |
execute(Operation op)
Executes an operation in the operation executor pool.
|
Map<Integer,Object> |
invokeOnAllPartitions(String serviceName,
OperationFactory operationFactory)
Invokes a set of operations on each partition.
|
<E> InternalCompletableFuture<E> |
invokeOnPartition(Operation op)
Executes an operation on a partition.
|
<E> InternalCompletableFuture<E> |
invokeOnPartition(String serviceName,
Operation op,
int partitionId) |
<T> Map<Integer,T> |
invokeOnPartitions(String serviceName,
OperationFactory operationFactory,
Collection<Integer> partitions)
Invokes a set of operations on selected set of partitions.
|
Map<Integer,Object> |
invokeOnPartitions(String serviceName,
OperationFactory operationFactory,
int[] partitions)
Invokes a set of operations on selected set of partitions.
|
<T> ICompletableFuture<Map<Integer,T>> |
invokeOnPartitionsAsync(String serviceName,
OperationFactory operationFactory,
Collection<Integer> partitions,
ExecutionCallback<Map<Integer,T>> callback)
Invokes a set of operations on selected set of partitions in an async way.
|
<E> InternalCompletableFuture<E> |
invokeOnTarget(String serviceName,
Operation op,
Address target) |
void |
run(Operation op)
Runs an operation in the calling thread.
|
boolean |
send(Operation op,
Address target)
Executes an operation remotely.
|
void run(Operation op)
op
- the operation to execute in the calling threadvoid execute(Operation op)
op
- the operation to execute in the operation executor pool.<E> InternalCompletableFuture<E> invokeOnPartition(String serviceName, Operation op, int partitionId)
<E> InternalCompletableFuture<E> invokeOnPartition(Operation op)
E
- the return type of the operation responseop
- the operation<E> InternalCompletableFuture<E> invokeOnTarget(String serviceName, Operation op, Address target)
InvocationBuilder createInvocationBuilder(String serviceName, Operation op, int partitionId)
InvocationBuilder createInvocationBuilder(String serviceName, Operation op, Address target)
Map<Integer,Object> invokeOnAllPartitions(String serviceName, OperationFactory operationFactory) throws Exception
This method blocks until the operation completes.
serviceName
- the name of the service.operationFactory
- the factory responsible for creating operationsException
<T> Map<Integer,T> invokeOnPartitions(String serviceName, OperationFactory operationFactory, Collection<Integer> partitions) throws Exception
This method blocks until all operations complete.
T
- type of result of operations returned by operationFactory
serviceName
- the name of the serviceoperationFactory
- the factory responsible for creating operationspartitions
- the partitions the operation should be executed on.Exception
- if there was an exception while waiting for the results
of the partition invocations<T> ICompletableFuture<Map<Integer,T>> invokeOnPartitionsAsync(String serviceName, OperationFactory operationFactory, Collection<Integer> partitions, ExecutionCallback<Map<Integer,T>> callback)
T
- type of result of operations returned by operationFactory
serviceName
- the name of the serviceoperationFactory
- the factory responsible for creating operationspartitions
- the partitions the operation should be executed on.callback
- optional callbackMap<Integer,Object> invokeOnPartitions(String serviceName, OperationFactory operationFactory, int[] partitions) throws Exception
This method blocks until all operations complete.
serviceName
- the name of the serviceoperationFactory
- the factory responsible for creating operationspartitions
- the partitions the operation should be executed on.Exception
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.