You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gossip.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/10/17 21:18:58 UTC

[jira] [Commented] (GOSSIP-30) Use getDeadMembers instead of getDeadList

    [ https://issues.apache.org/jira/browse/GOSSIP-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15583511#comment-15583511 ] 

ASF GitHub Bot commented on GOSSIP-30:
--------------------------------------

GitHub user patelrishabh opened a pull request:

    https://github.com/apache/incubator-gossip/pull/17

    GOSSIP-30 Use getDeadMembers instead of getDeadList

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/patelrishabh/incubator-gossip GOSSIP-30

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-gossip/pull/17.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #17
    
----
commit 3d0ccf52e516eabbb07bea5cc8a52aefb0f1ce67
Author: Rishabh Patel <ri...@gmail.com>
Date:   2016-10-17T20:04:43Z

    GOSSIP-30 Use getDeadMembers instead of getDeadList

----


> 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)