[ 
https://issues.apache.org/jira/browse/GOSSIP-30?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Work on GOSSIP-30 started by Rishabh Patel.
-------------------------------------------
> Use getDeadMembers instead of getDeadList
> -----------------------------------------
>
>                 Key: GOSSIP-30
>                 URL: https://issues.apache.org/jira/browse/GOSSIP-30
>             Project: Gossip
>          Issue Type: Improvement
>            Reporter: Rishabh Patel
>            Assignee: Rishabh Patel
>
> The getDeadList method is a duplicate of getDeadMembers
> {code:title=GossipManager.java}
> 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);
>   }
> public List<LocalGossipMember> getDeadList() {
>     List<LocalGossipMember> up = new ArrayList<>();
>     for (Entry<LocalGossipMember, GossipState> entry : members.entrySet()) {
>       if (GossipState.DOWN.equals(entry.getValue())) {
>         up.add(entry.getKey());
>       }
>     }
>     return Collections.unmodifiableList(up);
>   }
> {code}
> I recommend removing getDeadList, as now we can use the pair of similarly 
> named methods getLiveMembers and getDeadMembers



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to