コード例 #1
0
 public void removeMember(MemberImpl member) {
   checkServiceThread();
   logger.log(Level.FINEST, "ClusterManager removing  " + member);
   mapMembers.remove(member.getAddress());
   lsMembers.remove(member);
   memberMasterConfirmationTimes.remove(member);
   if (!member.isLiteMember()) {
     dataMemberCount.decrement();
   }
 }
コード例 #2
0
  public Member addMember(boolean checkServiceThread, MemberImpl member) {
    if (checkServiceThread) {
      checkServiceThread();
    }
    logger.log(Level.FINEST, "ClusterManager adding " + member);
    if (lsMembers.contains(member)) {
      for (MemberImpl m : lsMembers) {
        if (m.equals(member)) {
          member = m;
        }
      }
      mapMembers.put(member.getAddress(), member);
    } else {
      lsMembers.add(member);
      mapMembers.put(member.getAddress(), member);
      if (!member.isLiteMember()) {
        dataMemberCount.increment();
      }
    }

    memberMasterConfirmationTimes.put(member, Clock.currentTimeMillis());

    return member;
  }