Search in sources :

Example 1 with InvocationRegistry

use of com.hazelcast.spi.impl.operationservice.impl.InvocationRegistry 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 2 with InvocationRegistry

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

the class ClientDisconnectTest method assertNonEmptyPendingInvocationAndWaitSet.

private void assertNonEmptyPendingInvocationAndWaitSet(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() {
            assertFalse(invocationRegistry.entrySet().isEmpty());
        }
    });
    assertTrueEventually(new AssertTask() {

        @Override
        public void run() {
            assertTrue(operationParker.getTotalParkedOperationCount() > 0);
        }
    });
}
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 3 with InvocationRegistry

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

the class PromoteLiteMemberTest method assertPromotionInvocationStarted.

private void assertPromotionInvocationStarted(HazelcastInstance instance) {
    OperationServiceImpl operationService = getNode(instance).getNodeEngine().getOperationService();
    InvocationRegistry invocationRegistry = operationService.getInvocationRegistry();
    assertTrueEventually(() -> {
        for (Map.Entry<Long, Invocation> entry : invocationRegistry.entrySet()) {
            if (entry.getValue().op instanceof PromoteLiteMemberOp) {
                return;
            }
        }
        fail("Cannot find PromoteLiteMemberOp invocation!");
    });
}
Also used : Invocation(com.hazelcast.spi.impl.operationservice.impl.Invocation) PromoteLiteMemberOp(com.hazelcast.internal.cluster.impl.operations.PromoteLiteMemberOp) Map(java.util.Map) IMap(com.hazelcast.map.IMap) OperationServiceImpl(com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl) InvocationRegistry(com.hazelcast.spi.impl.operationservice.impl.InvocationRegistry)

Aggregations

InvocationRegistry (com.hazelcast.spi.impl.operationservice.impl.InvocationRegistry)3 OperationServiceImpl (com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl)3 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)2 OperationParkerImpl (com.hazelcast.spi.impl.operationparker.impl.OperationParkerImpl)2 Accessors.getNodeEngineImpl (com.hazelcast.test.Accessors.getNodeEngineImpl)2 AssertTask (com.hazelcast.test.AssertTask)2 PromoteLiteMemberOp (com.hazelcast.internal.cluster.impl.operations.PromoteLiteMemberOp)1 IMap (com.hazelcast.map.IMap)1 Invocation (com.hazelcast.spi.impl.operationservice.impl.Invocation)1 Map (java.util.Map)1