use of com.hazelcast.cp.internal.raftop.metadata.TerminateRaftNodesOp in project hazelcast by hazelcast.
the class MetadataRaftGroupManager method sendTerminateRaftNodeOpsForDestroyedGroup.
private void sendTerminateRaftNodeOpsForDestroyedGroup(CPGroupInfo group) {
Map<UUID, CPMemberInfo> activeMembersMap = getActiveMembersMap();
CPMemberInfo localCPMember = getLocalCPMember();
if (localCPMember == null) {
return;
}
RaftEndpoint localEndpoint = localCPMember.toRaftEndpoint();
OperationService operationService = nodeEngine.getOperationService();
for (RaftEndpoint endpoint : group.members()) {
if (endpoint.equals(localEndpoint)) {
terminateRaftNodeAsync(group.id());
} else {
Operation op = new TerminateRaftNodesOp(Collections.singleton(group.id()));
CPMemberInfo cpMember = activeMembersMap.get(endpoint.getUuid());
operationService.invokeOnTarget(SERVICE_NAME, op, cpMember.getAddress());
}
}
}
Aggregations