+ private void initializeDownPeerMemberNamesFromClusterState() {
+ java.util.Optional<Cluster> cluster = getRaftActorContext().getCluster();
+ if (!cluster.isPresent()) {
+ return;
+ }
+
+ CurrentClusterState state = cluster.get().state();
+ Set<Member> unreachable = state.getUnreachable();
+
+ LOG.debug(
+ "{}: initializeDownPeerMemberNamesFromClusterState - current downPeerMemberNames: {}, unreachable: {}",
+ persistenceId(), downPeerMemberNames, unreachable);
+
+ downPeerMemberNames.clear();
+ for (Member m: unreachable) {
+ downPeerMemberNames.add(MemberName.forName(m.getRoles().iterator().next()));
+ }
+
+ for (Member m: state.getMembers()) {
+ if (m.status() != MemberStatus.up() && m.status() != MemberStatus.weaklyUp()) {
+ LOG.debug("{}: Adding down member with status {}", persistenceId(), m.status());
+ downPeerMemberNames.add(MemberName.forName(m.getRoles().iterator().next()));
+ }
+ }
+
+ LOG.debug("{}: new downPeerMemberNames: {}", persistenceId(), downPeerMemberNames);
+ }
+
+ private void onCandidateRemoved(final CandidateRemoved message) {