geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hiteshkhame...@apache.org
Subject [1/2] incubator-geode git commit: GEODE-2011 Client code which clears pdx registry needs synchronization
Date Sat, 22 Oct 2016 04:30:54 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 8bf395714 -> 24a72040c


GEODE-2011 Client code which clears pdx registry needs synchronization

We clear pdx registry in client when we re-connect to cluster. But
during that time other thread may end up using old registry while other
thread is clearing this. Thus we need to synchronize that. In current
code it happens through listener events and I modified that notification
to synchronize this.


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

Branch: refs/heads/develop
Commit: 6eb0fd398e9bff7798939df6781aa52979ef9693
Parents: 8bf3957
Author: Hitesh Khamesra <hkhamesra@pivotal.io>
Authored: Fri Oct 21 15:52:00 2016 -0700
Committer: Hitesh Khamesra <hkhamesra@pivotal.io>
Committed: Fri Oct 21 15:52:00 2016 -0700

----------------------------------------------------------------------
 .../cache/client/internal/EndpointManagerImpl.java   | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6eb0fd39/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java
b/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java
index f594278..ec8a818 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java
@@ -77,6 +77,7 @@ public class EndpointManagerImpl implements EndpointManager {
           Map<ServerLocation, Endpoint> endpointMapTemp =
               new HashMap<ServerLocation, Endpoint>(endpointMap);
           endpoint = new Endpoint(this, ds, server, stats, memberId);
+          listener.clearPdxRegistry(endpoint);
           endpointMapTemp.put(server, endpoint);
           endpointMap = Collections.unmodifiableMap(endpointMapTemp);
           addedEndpoint = true;
@@ -291,9 +292,21 @@ public class EndpointManagerImpl implements EndpointManager {
       // logger.warn("HIGHUP:JOIN:"+endpoint.getLocation());
       for (Iterator<EndpointListener> itr = endpointListeners.iterator(); itr.hasNext();)
{
         EndpointManager.EndpointListener listener = itr.next();
-        listener.endpointNowInUse(endpoint);
+        if (!(listener instanceof PdxRegistryRecoveryListener)) {
+          listener.endpointNowInUse(endpoint);
+        }
+      }
+    }
+
+    public void clearPdxRegistry(Endpoint endpoint) {
+      for (Iterator<EndpointListener> itr = endpointListeners.iterator(); itr.hasNext();)
{
+        EndpointManager.EndpointListener listener = itr.next();
+        if (listener instanceof PdxRegistryRecoveryListener) {
+          listener.endpointNowInUse(endpoint);
+        }
       }
     }
+
   }
 
 


Mime
View raw message