periodically attempt to contact dead members

This commit is contained in:
Gary Dusbabek
2016-07-18 14:09:43 -05:00
parent d2e8c62b29
commit c4cb0d7c6c
4 changed files with 29 additions and 3 deletions

View File

@ -132,6 +132,21 @@ public abstract class GossipManager extends Thread implements NotificationListen
return settings;
}
// TODO: Use some java 8 goodness for these functions.
/**
* @return a read only list of members found in the DOWN state.
*/
public List<LocalGossipMember> getDeadMembers() {
List<LocalGossipMember> down = new ArrayList<>();
for (Entry<LocalGossipMember, GossipState> entry : members.entrySet()) {
if (GossipState.DOWN.equals(entry.getValue())) {
down.add(entry.getKey());
}
}
return Collections.unmodifiableList(down);
}
/**
*
* @return a read only list of members found in the UP state