Search in sources :

Example 91 with Operation

use of com.hazelcast.spi.Operation in project hazelcast by hazelcast.

the class AtomicLongProxy method alterAndGetAsync.

@Override
public InternalCompletableFuture<Long> alterAndGetAsync(IFunction<Long, Long> function) {
    isNotNull(function, "function");
    Operation operation = new AlterAndGetOperation(name, function).setPartitionId(partitionId);
    return invokeOnPartition(operation);
}
Also used : AlterAndGetOperation(com.hazelcast.concurrent.atomiclong.operations.AlterAndGetOperation) Operation(com.hazelcast.spi.Operation) AddAndGetOperation(com.hazelcast.concurrent.atomiclong.operations.AddAndGetOperation) ApplyOperation(com.hazelcast.concurrent.atomiclong.operations.ApplyOperation) GetAndAlterOperation(com.hazelcast.concurrent.atomiclong.operations.GetAndAlterOperation) GetOperation(com.hazelcast.concurrent.atomiclong.operations.GetOperation) GetAndSetOperation(com.hazelcast.concurrent.atomiclong.operations.GetAndSetOperation) AlterAndGetOperation(com.hazelcast.concurrent.atomiclong.operations.AlterAndGetOperation) SetOperation(com.hazelcast.concurrent.atomiclong.operations.SetOperation) GetAndAddOperation(com.hazelcast.concurrent.atomiclong.operations.GetAndAddOperation) CompareAndSetOperation(com.hazelcast.concurrent.atomiclong.operations.CompareAndSetOperation) AlterOperation(com.hazelcast.concurrent.atomiclong.operations.AlterOperation)

Example 92 with Operation

use of com.hazelcast.spi.Operation in project hazelcast by hazelcast.

the class AtomicLongProxy method alterAsync.

@Override
public InternalCompletableFuture<Void> alterAsync(IFunction<Long, Long> function) {
    isNotNull(function, "function");
    Operation operation = new AlterOperation(name, function).setPartitionId(partitionId);
    return invokeOnPartition(operation);
}
Also used : GetAndAlterOperation(com.hazelcast.concurrent.atomiclong.operations.GetAndAlterOperation) AlterOperation(com.hazelcast.concurrent.atomiclong.operations.AlterOperation) Operation(com.hazelcast.spi.Operation) AddAndGetOperation(com.hazelcast.concurrent.atomiclong.operations.AddAndGetOperation) ApplyOperation(com.hazelcast.concurrent.atomiclong.operations.ApplyOperation) GetAndAlterOperation(com.hazelcast.concurrent.atomiclong.operations.GetAndAlterOperation) GetOperation(com.hazelcast.concurrent.atomiclong.operations.GetOperation) GetAndSetOperation(com.hazelcast.concurrent.atomiclong.operations.GetAndSetOperation) AlterAndGetOperation(com.hazelcast.concurrent.atomiclong.operations.AlterAndGetOperation) SetOperation(com.hazelcast.concurrent.atomiclong.operations.SetOperation) GetAndAddOperation(com.hazelcast.concurrent.atomiclong.operations.GetAndAddOperation) CompareAndSetOperation(com.hazelcast.concurrent.atomiclong.operations.CompareAndSetOperation) AlterOperation(com.hazelcast.concurrent.atomiclong.operations.AlterOperation)

Example 93 with Operation

use of com.hazelcast.spi.Operation in project hazelcast by hazelcast.

the class AtomicLongProxy method getAndAlterAsync.

@Override
public InternalCompletableFuture<Long> getAndAlterAsync(IFunction<Long, Long> function) {
    isNotNull(function, "function");
    Operation operation = new GetAndAlterOperation(name, function).setPartitionId(partitionId);
    return invokeOnPartition(operation);
}
Also used : GetAndAlterOperation(com.hazelcast.concurrent.atomiclong.operations.GetAndAlterOperation) Operation(com.hazelcast.spi.Operation) AddAndGetOperation(com.hazelcast.concurrent.atomiclong.operations.AddAndGetOperation) ApplyOperation(com.hazelcast.concurrent.atomiclong.operations.ApplyOperation) GetAndAlterOperation(com.hazelcast.concurrent.atomiclong.operations.GetAndAlterOperation) GetOperation(com.hazelcast.concurrent.atomiclong.operations.GetOperation) GetAndSetOperation(com.hazelcast.concurrent.atomiclong.operations.GetAndSetOperation) AlterAndGetOperation(com.hazelcast.concurrent.atomiclong.operations.AlterAndGetOperation) SetOperation(com.hazelcast.concurrent.atomiclong.operations.SetOperation) GetAndAddOperation(com.hazelcast.concurrent.atomiclong.operations.GetAndAddOperation) CompareAndSetOperation(com.hazelcast.concurrent.atomiclong.operations.CompareAndSetOperation) AlterOperation(com.hazelcast.concurrent.atomiclong.operations.AlterOperation)

Example 94 with Operation

use of com.hazelcast.spi.Operation in project hazelcast by hazelcast.

the class CollectionTxnUtilTest method testBefore.

@Test
public void testBefore() throws Exception {
    CollectionTxnUtil.before(operationList, wrapper);
    for (Operation operation : operationList) {
        TestOperation op = (TestOperation) operation;
        assertTrue(op.beforeCalled);
        assertEquals(remoteService, op.getService());
        assertEquals(serviceName, op.getServiceName());
        assertEquals(callerUuid, op.getCallerUuid());
        assertEquals(nodeEngine, op.getNodeEngine());
        assertEquals(partitionId, op.getPartitionId());
    }
}
Also used : BackupAwareOperation(com.hazelcast.spi.BackupAwareOperation) Operation(com.hazelcast.spi.Operation) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

Operation (com.hazelcast.spi.Operation)94 OperationService (com.hazelcast.spi.OperationService)14 Member (com.hazelcast.core.Member)13 Address (com.hazelcast.nio.Address)11 InternalCompletableFuture (com.hazelcast.spi.InternalCompletableFuture)8 ArrayList (java.util.ArrayList)8 ILogger (com.hazelcast.logging.ILogger)7 UrgentSystemOperation (com.hazelcast.spi.UrgentSystemOperation)7 ParallelTest (com.hazelcast.test.annotation.ParallelTest)7 QuickTest (com.hazelcast.test.annotation.QuickTest)7 Test (org.junit.Test)7 AcquireOperation (com.hazelcast.concurrent.semaphore.operations.AcquireOperation)6 AvailableOperation (com.hazelcast.concurrent.semaphore.operations.AvailableOperation)6 DrainOperation (com.hazelcast.concurrent.semaphore.operations.DrainOperation)6 InitOperation (com.hazelcast.concurrent.semaphore.operations.InitOperation)6 ReduceOperation (com.hazelcast.concurrent.semaphore.operations.ReduceOperation)6 ReleaseOperation (com.hazelcast.concurrent.semaphore.operations.ReleaseOperation)6 MemberInfo (com.hazelcast.internal.cluster.MemberInfo)6 NodeEngine (com.hazelcast.spi.NodeEngine)6 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)6