You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by tf...@apache.org on 2018/03/15 19:22:21 UTC

lucene-solr:master: SOLR-11960: Don't add property listeners on core registration

Repository: lucene-solr
Updated Branches:
  refs/heads/master d50890e92 -> 67dab22f2


SOLR-11960: Don't add property listeners on core registration


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/67dab22f
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/67dab22f
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/67dab22f

Branch: refs/heads/master
Commit: 67dab22f295c8a9966c3c35c722f2f28626d7ec8
Parents: d50890e
Author: Tomas Fernandez Lobbe <tf...@apache.org>
Authored: Thu Mar 15 12:21:20 2018 -0700
Committer: Tomas Fernandez Lobbe <tf...@apache.org>
Committed: Thu Mar 15 12:21:20 2018 -0700

----------------------------------------------------------------------
 .../apache/solr/common/cloud/ZkStateReader.java | 30 +++-----------------
 1 file changed, 4 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/67dab22f/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
index 1a4e7ad..057c4da 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
@@ -451,6 +451,10 @@ public class ZkStateReader implements Closeable {
       });
       securityData = getSecurityProps(true);
     }
+
+    collectionPropsWatches.forEach((k,v) -> {
+      new PropsWatcher(k).refreshAndWatch(true);
+    });
   }
 
   private void addSecurityNodeWatcher(final Callable<Pair<byte[], Stat>> callback)
@@ -1295,20 +1299,6 @@ public class ZkStateReader implements Closeable {
     if (reconstructState.get()) {
       new StateWatcher(collection).refreshAndWatch();
     }
-
-    AtomicBoolean addPropsWatch = new AtomicBoolean(false);
-    collectionPropsWatches.compute(collection, (k, v) -> {
-      if (v == null) {
-        addPropsWatch.set(true);
-        v = new CollectionWatch<>();
-      }
-      v.coreRefCount++;
-      return v;
-    });
-
-    if (addPropsWatch.get()) {
-      new PropsWatcher(collection).refreshAndWatch(false);
-    }
   }
 
   /**
@@ -1341,18 +1331,6 @@ public class ZkStateReader implements Closeable {
         constructState(Collections.emptySet());
       }
     }
-
-    collectionPropsWatches.compute(collection, (k, v) -> {
-      if (v == null)
-        return null;
-      if (v.coreRefCount > 0)
-        v.coreRefCount--;
-      if (v.canBeRemoved()) {
-        watchedCollectionProps.remove(collection);
-        return null;
-      }
-      return v;
-    });
   }
 
   /**