Uploaded image for project: 'Gossip'
  1. Gossip
  2. GOSSIP-30

Use getDeadMembers instead of getDeadList

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      The getDeadList method is a duplicate of getDeadMembers

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

      I recommend removing getDeadList, as now we can use the pair of similarly named methods getLiveMembers and getDeadMembers

      Attachments

        Issue Links

          Activity

            People

              rmp91 Rishabh Patel
              rmp91 Rishabh Patel
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: