use of com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl in project hazelcast by hazelcast.
the class FrozenPartitionTableTest method partitionTable_shouldBeFixed_whenMemberRestarts_usingUuidOfAnotherMissingMember.
@Test
public void partitionTable_shouldBeFixed_whenMemberRestarts_usingUuidOfAnotherMissingMember() {
ruleStaleJoinPreventionDuration.setOrClearProperty("5");
TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory();
HazelcastInstance hz1 = factory.newHazelcastInstance();
HazelcastInstance hz2 = factory.newHazelcastInstance();
HazelcastInstance hz3 = factory.newHazelcastInstance();
HazelcastInstance hz4 = factory.newHazelcastInstance();
assertClusterSizeEventually(4, hz2, hz3);
warmUpPartitions(hz1, hz2, hz3, hz4);
changeClusterStateEventually(hz4, ClusterState.FROZEN);
int member3PartitionId = getPartitionId(hz3);
int member4PartitionId = getPartitionId(hz4);
MemberImpl member3 = getNode(hz3).getLocalMember();
MemberImpl member4 = getNode(hz4).getLocalMember();
hz3.shutdown();
hz4.shutdown();
assertClusterSizeEventually(2, hz1, hz2);
newHazelcastInstance(initOrCreateConfig(new Config()), randomName(), new StaticMemberNodeContext(factory, member4.getUuid(), member3.getAddress()));
assertClusterSizeEventually(3, hz1, hz2);
waitAllForSafeState(hz1, hz2);
OperationServiceImpl operationService = getOperationService(hz1);
operationService.invokeOnPartition(null, new NonRetryablePartitionOperation(), member3PartitionId).join();
try {
operationService.invokeOnPartition(null, new NonRetryablePartitionOperation(), member4PartitionId).joinInternal();
fail("Invocation to missing member should have failed!");
} catch (TargetNotMemberException ignored) {
}
}
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;
}
use of com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl in project hazelcast by hazelcast.
the class CreateProxyMessageTask method getInvocationBuilder.
@Override
protected InvocationBuilder getInvocationBuilder(Operation op) {
final OperationServiceImpl operationService = nodeEngine.getOperationService();
if (!nodeEngine.getLocalMember().isLiteMember()) {
// if this is a data member run the create proxy here
return operationService.createInvocationBuilder(getServiceName(), op, nodeEngine.getThisAddress());
}
// otherwise find a data member to send the operation
Collection<Member> members = nodeEngine.getClusterService().getMembers(MemberSelectors.DATA_MEMBER_SELECTOR);
Iterator<Member> iterator = members.iterator();
if (iterator.hasNext()) {
Member member = iterator.next();
Address address = member.getAddress();
return operationService.createInvocationBuilder(getServiceName(), op, address);
}
// if no data member found run on this member. CreateProxy operation itself will send exception if not able to create.
return operationService.createInvocationBuilder(getServiceName(), op, nodeEngine.getThisAddress());
}
use of com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl in project hazelcast by hazelcast.
the class AbstractAllPartitionsMessageTask method processInternal.
@Override
protected CompletableFuture<Map<Integer, Object>> processInternal() {
OperationFactory operationFactory = new OperationFactoryWrapper(createOperationFactory(), endpoint.getUuid());
OperationServiceImpl operationService = nodeEngine.getOperationService();
return operationService.invokeOnAllPartitionsAsync(getServiceName(), operationFactory);
}
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.getBackupHandler().notifyBackupComplete(callId);
}
Aggregations