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());
}
}
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());
}
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());
}
});
}
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;
}
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);
}
}
Aggregations