geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject [2/6] incubator-geode git commit: GEODE-1874: Changed setNextNeighbor to not create HashMap for every p2p invocation
Date Mon, 07 Nov 2016 20:22:09 GMT
GEODE-1874: Changed setNextNeighbor to not create HashMap for every p2p invocation


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/b0c6f05b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/b0c6f05b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/b0c6f05b

Branch: refs/heads/develop
Commit: b0c6f05b22a2cfda4005b1812285c77ad24d7c44
Parents: 593c702
Author: Udo Kohlmeyer <ukohlmeyer@pivotal.io>
Authored: Thu Oct 13 10:46:44 2016 +1100
Committer: Udo Kohlmeyer <ukohlmeyer@pivotal.io>
Committed: Tue Nov 8 07:09:19 2016 +1100

----------------------------------------------------------------------
 .../internal/membership/gms/fd/GMSHealthMonitor.java | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b0c6f05b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
index 97a413c..b3598cd 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
@@ -374,15 +374,14 @@ public class GMSHealthMonitor implements HealthMonitor, MessageHandler
{
    */
   private void contactedBy(InternalDistributedMember sender, long timeStamp) {
     TimeStamp cTS = new TimeStamp(timeStamp);
-    //TODO Udo: why putIfAbsent. Surely only put is required
     cTS = memberTimeStamps.putIfAbsent(sender, cTS);
     if (cTS != null && cTS.getTime() < timeStamp) {
       cTS.setTime(timeStamp);
     }
     if (suspectedMemberInView.remove(sender) != null) {
       logger.info("No longer suspecting {}", sender);
+      setNextNeighbor(currentView, null);
     }
-    setNextNeighbor(currentView, null);
   }
 
 
@@ -834,7 +833,7 @@ public class GMSHealthMonitor implements HealthMonitor, MessageHandler
{
     }
 
     List<InternalDistributedMember> allMembers = newView.getMembers();
-
+    //
     //    Set<InternalDistributedMember> checkAllSuspected = new HashSet<>(allMembers);
     //    checkAllSuspected.removeAll(suspectedMemberInView.keySet());
     //    checkAllSuspected.remove(localAddress);
@@ -1066,10 +1065,7 @@ public class GMSHealthMonitor implements HealthMonitor, MessageHandler
{
 
   private void processHeartbeat(HeartbeatMessage m) {
     this.stats.incHeartbeatsReceived();
-    if (m.getRequestId() < 0) {
-      // a periodic heartbeat
-      contactedBy(m.getSender(), System.currentTimeMillis());
-    } else {
+    if (m.getRequestId() >= 0) {
       Response resp = requestIdVsResponse.get(m.getRequestId());
       logger.trace("Got heartbeat from member {}. {}", m.getSender(), (resp != null ? "Check
thread still waiting" : "Check thread is not waiting"));
       if (resp != null) {
@@ -1078,9 +1074,10 @@ public class GMSHealthMonitor implements HealthMonitor, MessageHandler
{
           resp.notify();
         }
       }
-      //we got heartbeat lets update timestamp
-      contactedBy(m.getSender(), System.currentTimeMillis());
+
     }
+    //we got heartbeat lets update timestamp
+    contactedBy(m.getSender(), System.currentTimeMillis());
   }
 
   /**


Mime
View raw message