Search in sources :

Example 11 with OperationServiceImpl

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

the class Backup method afterRun.

@Override
public void afterRun() throws Exception {
    if (validationFailure != null || !sync || getCallId() == 0 || originalCaller == null) {
        return;
    }
    NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
    long callId = getCallId();
    OperationServiceImpl operationService = nodeEngine.getOperationService();
    if (isCallerClient()) {
        ClientEngine clientEngine = ((NodeEngineImpl) getNodeEngine()).getNode().getClientEngine();
        UUID clientUUID = getCallerUuid();
        clientEngine.dispatchBackupEvent(clientUUID, clientCorrelationId);
    } else if (nodeEngine.getThisAddress().equals(originalCaller)) {
        operationService.getBackupHandler().notifyBackupComplete(callId);
    } else {
        operationService.getOutboundResponseHandler().sendBackupAck(getConnection().getConnectionManager(), originalCaller, callId, backupOp.isUrgent());
    }
}
Also used : NodeEngineImpl(com.hazelcast.spi.impl.NodeEngineImpl) ClientEngine(com.hazelcast.client.impl.ClientEngine) UUID(java.util.UUID) OperationServiceImpl(com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl)

Example 12 with OperationServiceImpl

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

the class InternalCacheRecordStoreTest method verifyPrimaryState.

private void verifyPrimaryState(Node node, String fullCacheName, int partitionId, boolean expectedState) throws Exception {
    NodeEngineImpl nodeEngine = node.getNodeEngine();
    OperationServiceImpl operationService = nodeEngine.getOperationService();
    Future<Boolean> isPrimaryOnNode = operationService.invokeOnTarget(ICacheService.SERVICE_NAME, createCacheOwnerStateGetterOperation(fullCacheName, partitionId), node.getThisAddress());
    assertEquals(expectedState, isPrimaryOnNode.get());
}
Also used : NodeEngineImpl(com.hazelcast.spi.impl.NodeEngineImpl) OperationServiceImpl(com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl)

Example 13 with OperationServiceImpl

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

the class ClientDisconnectTest method assertEmptyPendingInvocationAndWaitSet.

private void assertEmptyPendingInvocationAndWaitSet(HazelcastInstance server) {
    NodeEngineImpl nodeEngine = getNodeEngineImpl(server);
    OperationServiceImpl operationService = (OperationServiceImpl) nodeEngine.getOperationService();
    final InvocationRegistry invocationRegistry = operationService.getInvocationRegistry();
    final OperationParkerImpl operationParker = (OperationParkerImpl) nodeEngine.getOperationParker();
    assertTrueEventually(new AssertTask() {

        @Override
        public void run() {
            assertTrue(invocationRegistry.entrySet().isEmpty());
        }
    });
    assertTrueEventually(new AssertTask() {

        @Override
        public void run() {
            assertEquals(0, operationParker.getTotalParkedOperationCount());
        }
    });
}
Also used : NodeEngineImpl(com.hazelcast.spi.impl.NodeEngineImpl) Accessors.getNodeEngineImpl(com.hazelcast.test.Accessors.getNodeEngineImpl) AssertTask(com.hazelcast.test.AssertTask) OperationServiceImpl(com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl) InvocationRegistry(com.hazelcast.spi.impl.operationservice.impl.InvocationRegistry) OperationParkerImpl(com.hazelcast.spi.impl.operationparker.impl.OperationParkerImpl)

Example 14 with OperationServiceImpl

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

the class CardinalityEstimatorBackupTest method readEstimate.

private long readEstimate(final HazelcastInstance instance) {
    final OperationServiceImpl operationService = (OperationServiceImpl) getOperationService(instance);
    final CardinalityEstimatorService cardinalityEstimatorService = getNodeEngineImpl(instance).getService(CardinalityEstimatorService.SERVICE_NAME);
    final CardinalityEstimatorBackupTest.GetEstimate task = new CardinalityEstimatorBackupTest.GetEstimate(cardinalityEstimatorService);
    operationService.execute(task);
    assertOpenEventually(task.latch);
    return task.value;
}
Also used : OperationServiceImpl(com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl) CardinalityEstimatorService(com.hazelcast.cardinality.impl.CardinalityEstimatorService)

Example 15 with OperationServiceImpl

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

the class ClientEngineImpl method accept.

public void accept(ClientMessage clientMessage) {
    Connection connection = clientMessage.getConnection();
    MessageTask messageTask = messageTaskFactory.create(clientMessage, connection);
    OperationServiceImpl operationService = nodeEngine.getOperationService();
    if (isUrgent(messageTask)) {
        operationService.execute((UrgentMessageTask) messageTask);
    } else if (messageTask instanceof AbstractPartitionMessageTask) {
        operationService.execute((AbstractPartitionMessageTask) messageTask);
    } else if (isQuery(messageTask)) {
        queryExecutor.execute(messageTask);
    } else if (messageTask instanceof TransactionalMessageTask) {
        blockingExecutor.execute(messageTask);
    } else if (messageTask instanceof BlockingMessageTask) {
        blockingExecutor.execute(messageTask);
    } else {
        executor.execute(messageTask);
    }
}
Also used : BlockingMessageTask(com.hazelcast.client.impl.protocol.task.BlockingMessageTask) UrgentMessageTask(com.hazelcast.client.impl.protocol.task.UrgentMessageTask) AbstractMapQueryMessageTask(com.hazelcast.client.impl.protocol.task.map.AbstractMapQueryMessageTask) SqlAbstractMessageTask(com.hazelcast.sql.impl.client.SqlAbstractMessageTask) AuthenticationBaseMessageTask(com.hazelcast.client.impl.protocol.task.AuthenticationBaseMessageTask) MessageTask(com.hazelcast.client.impl.protocol.task.MessageTask) TransactionalMessageTask(com.hazelcast.client.impl.protocol.task.TransactionalMessageTask) AbstractPartitionMessageTask(com.hazelcast.client.impl.protocol.task.AbstractPartitionMessageTask) ServerConnection(com.hazelcast.internal.server.ServerConnection) Connection(com.hazelcast.internal.nio.Connection) AbstractPartitionMessageTask(com.hazelcast.client.impl.protocol.task.AbstractPartitionMessageTask) BlockingMessageTask(com.hazelcast.client.impl.protocol.task.BlockingMessageTask) OperationServiceImpl(com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl) TransactionalMessageTask(com.hazelcast.client.impl.protocol.task.TransactionalMessageTask)

Aggregations

OperationServiceImpl (com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl)70 Test (org.junit.Test)29 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)26 QuickTest (com.hazelcast.test.annotation.QuickTest)25 Address (com.hazelcast.cluster.Address)22 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)16 HazelcastInstance (com.hazelcast.core.HazelcastInstance)15 Operation (com.hazelcast.spi.impl.operationservice.Operation)12 PartitionIdSet (com.hazelcast.internal.util.collection.PartitionIdSet)11 IndexIterationPointer (com.hazelcast.internal.iteration.IndexIterationPointer)10 MapFetchIndexOperationResult (com.hazelcast.map.impl.operation.MapFetchIndexOperation.MapFetchIndexOperationResult)10 Config (com.hazelcast.config.Config)9 ExecutionException (java.util.concurrent.ExecutionException)9 Accessors.getNodeEngineImpl (com.hazelcast.test.Accessors.getNodeEngineImpl)8 AssertTask (com.hazelcast.test.AssertTask)7 CountDownLatch (java.util.concurrent.CountDownLatch)7 Member (com.hazelcast.cluster.Member)5 Data (com.hazelcast.internal.serialization.Data)5 MapService (com.hazelcast.map.impl.MapService)5 MapServiceContext (com.hazelcast.map.impl.MapServiceContext)5