use of com.hazelcast.spi.Operation in project hazelcast by hazelcast.
the class CollectionTxnUtil method before.
public static void before(List<Operation> operationList, Operation wrapper) throws Exception {
for (Operation operation : operationList) {
operation.setService(wrapper.getService());
operation.setServiceName(wrapper.getServiceName());
operation.setCallerUuid(wrapper.getCallerUuid());
operation.setNodeEngine(wrapper.getNodeEngine());
operation.setPartitionId(wrapper.getPartitionId());
operation.beforeRun();
}
}
use of com.hazelcast.spi.Operation in project hazelcast by hazelcast.
the class CollectionService method rollbackTransaction.
@Override
public void rollbackTransaction(String transactionId) {
final Set<String> collectionNames = getContainerMap().keySet();
IPartitionService partitionService = nodeEngine.getPartitionService();
OperationService operationService = nodeEngine.getOperationService();
for (String name : collectionNames) {
int partitionId = partitionService.getPartitionId(StringPartitioningStrategy.getPartitionKey(name));
Operation operation = new CollectionTransactionRollbackOperation(name, transactionId).setPartitionId(partitionId).setService(this).setNodeEngine(nodeEngine);
operationService.execute(operation);
}
}
use of com.hazelcast.spi.Operation in project hazelcast by hazelcast.
the class AtomicReferenceProxy method alterAndGetAsync.
@Override
public InternalCompletableFuture<E> alterAndGetAsync(IFunction<E, E> function) {
isNotNull(function, "function");
Operation operation = new AlterAndGetOperation(name, toData(function)).setPartitionId(partitionId);
return invokeOnPartition(operation);
}
use of com.hazelcast.spi.Operation in project hazelcast by hazelcast.
the class AtomicReferenceProxy method getAndAlterAsync.
@Override
public InternalCompletableFuture<E> getAndAlterAsync(IFunction<E, E> function) {
isNotNull(function, "function");
Operation operation = new GetAndAlterOperation(name, toData(function)).setPartitionId(partitionId);
return invokeOnPartition(operation);
}
use of com.hazelcast.spi.Operation in project hazelcast by hazelcast.
the class AtomicReferenceProxy method alterAsync.
@Override
public InternalCompletableFuture<Void> alterAsync(IFunction<E, E> function) {
isNotNull(function, "function");
Operation operation = new AlterOperation(name, toData(function)).setPartitionId(partitionId);
return invokeOnPartition(operation);
}
Aggregations