use of com.hazelcast.spi.CallsPerMember in project hazelcast by hazelcast.
the class OperationParkerImpl_populateTest method populateRemoteCall.
@Test
public void populateRemoteCall() {
TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
HazelcastInstance local = factory.newHazelcastInstance();
HazelcastInstance remote = factory.newHazelcastInstance();
NodeEngineImpl nodeEngine = getNode(local).nodeEngine;
OperationParkerImpl operationParker = (OperationParkerImpl) nodeEngine.getOperationParker();
Address thisAddress = getNode(local).nodeEngine.getThisAddress();
Address thatAddress = getNode(remote).nodeEngine.getThisAddress();
DummyBlockingOperation blockingOperation = new DummyBlockingOperation(new WaitNotifyKeyImpl());
setCallerAddress(blockingOperation, thatAddress);
setCallId(blockingOperation, 100);
operationParker.park(blockingOperation);
CallsPerMember callsPerMember = new CallsPerMember(thisAddress);
operationParker.populate(callsPerMember);
assertEquals(singleton(thatAddress), callsPerMember.addresses());
assertArrayEquals(new long[] { 100 }, callsPerMember.toOpControl(thatAddress).runningOperations());
}
use of com.hazelcast.spi.CallsPerMember in project hazelcast by hazelcast.
the class OperationParkerImpl_populateTest method populateLocalCall.
@Test
public void populateLocalCall() {
HazelcastInstance hz = createHazelcastInstance();
NodeEngineImpl nodeEngine = getNode(hz).nodeEngine;
OperationParkerImpl operationParker = (OperationParkerImpl) nodeEngine.getOperationParker();
Address thisAddress = nodeEngine.getThisAddress();
DummyBlockingOperation blockingOperation = new DummyBlockingOperation(new WaitNotifyKeyImpl());
setCallId(blockingOperation, 100);
operationParker.park(blockingOperation);
CallsPerMember callsPerMember = new CallsPerMember(thisAddress);
operationParker.populate(callsPerMember);
assertEquals(singleton(thisAddress), callsPerMember.addresses());
assertArrayEquals(new long[] { 100 }, callsPerMember.toOpControl(thisAddress).runningOperations());
}
Aggregations