Search in sources :

Example 6 with OperationServiceImpl

use of com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl in project hazelcast by hazelcast.

the class ReplicateUpdateToCallerOperation method notifyCaller.

private void notifyCaller() {
    OperationServiceImpl operationService = (OperationServiceImpl) getNodeEngine().getOperationService();
    operationService.getInboundResponseHandler().notifyBackupComplete(callId);
}
Also used : OperationServiceImpl(com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl)

Example 7 with OperationServiceImpl

use of com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl in project hazelcast by hazelcast.

the class OperationFactoryWrapperTest method testOperationSeesActualCallersUUID.

/**
     * OperationFactoryWrapper gets a UUID and sets it to its created operations.
     * This test ensures UUID doesn't change through the operation system.
     */
@Test
public void testOperationSeesActualCallersUUID() throws Exception {
    HazelcastInstance hz = createHazelcastInstance();
    OperationServiceImpl operationService = getOperationServiceImpl(hz);
    String expectedCallersUUID = UUID.randomUUID().toString();
    GetCallersUUIDOperationFactory operationFactory = new GetCallersUUIDOperationFactory();
    OperationFactoryWrapper wrapper = new OperationFactoryWrapper(operationFactory, expectedCallersUUID);
    int partitionID = 0;
    Map<Integer, Object> responses = operationService.invokeOnPartitions(SERVICE_NAME, wrapper, asList(partitionID));
    String actualCallersUUID = (String) responses.get(partitionID);
    assertEquals("Callers UUID should not be changed", expectedCallersUUID, actualCallersUUID);
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) OperationServiceImpl(com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 8 with OperationServiceImpl

use of com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl in project hazelcast by hazelcast.

the class AtomicLongBackupTest method readAtomicLongValue.

private long readAtomicLongValue(final HazelcastInstance instance) {
    final OperationServiceImpl operationService = (OperationServiceImpl) getOperationService(instance);
    final AtomicLongService atomicLongService = getNodeEngineImpl(instance).getService(AtomicLongService.SERVICE_NAME);
    final GetLongValue task = new GetLongValue(atomicLongService);
    operationService.execute(task);
    assertOpenEventually(task.latch);
    return task.value;
}
Also used : OperationServiceImpl(com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl)

Aggregations

OperationServiceImpl (com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl)8 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)3 Node (com.hazelcast.instance.Node)2 MergeOperation (com.hazelcast.map.impl.operation.MergeOperation)2 Record (com.hazelcast.map.impl.record.Record)2 PassThroughMergePolicy (com.hazelcast.map.merge.PassThroughMergePolicy)2 Data (com.hazelcast.nio.serialization.Data)2 SerializationService (com.hazelcast.spi.serialization.SerializationService)2 ParallelTest (com.hazelcast.test.annotation.ParallelTest)2 QuickTest (com.hazelcast.test.annotation.QuickTest)2 Test (org.junit.Test)2 CardinalityEstimatorService (com.hazelcast.cardinality.impl.CardinalityEstimatorService)1 EntryView (com.hazelcast.core.EntryView)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 BackupAckResponse (com.hazelcast.spi.impl.operationservice.impl.responses.BackupAckResponse)1 CountDownLatch (java.util.concurrent.CountDownLatch)1