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.
|
<T> ICompletableFuture<Map<Integer,T>> |
invokeOnAllPartitionsAsync(String serviceName,
OperationFactory operationFactory)
Invokes a set of operations on selected set of all partitions in an async way.
|
<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)
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 operations complete.
If the operations have sync backups, this method will not wait for their completion.
Instead, it will return once the operations are completed on primary replicas of the
given partitions
.
serviceName
- the name of the service.operationFactory
- the factory responsible for creating operationsException
<T> ICompletableFuture<Map<Integer,T>> invokeOnAllPartitionsAsync(String serviceName, OperationFactory operationFactory)
If the operations have sync backups, the returned ICompletableFuture
does not
wait for their completion. Instead, the ICompletableFuture
is completed once the
operations are completed on primary replicas of the given partitions
.
T
- type of result of operations returned by operationFactory
serviceName
- the name of the serviceoperationFactory
- the factory responsible for creating operations<T> Map<Integer,T> invokeOnPartitions(String serviceName, OperationFactory operationFactory, Collection<Integer> partitions) throws Exception
This method blocks until all operations complete.
If the operations have sync backups, this method will not wait for their completion.
Instead, it will return once the operations are completed on primary replicas of the given partitions
.
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)
If the operations have sync backups, the returned ICompletableFuture
does not
wait for their completion. Instead, the ICompletableFuture
is completed once the
operations are completed on primary replicas of the given partitions
.
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.Map<Integer,Object> invokeOnPartitions(String serviceName, OperationFactory operationFactory, int[] partitions) throws Exception
This method blocks until all operations complete.
If the operations have sync backups, this method will not wait for their completion.
Instead, it will return once the operations are completed on primary replicas of the given partitions
.
serviceName
- the name of the serviceoperationFactory
- the factory responsible for creating operationspartitions
- the partitions the operation should be executed on.Exception
Copyright © 2022 Hazelcast, Inc.. All Rights Reserved.