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:28:37 UTC
lucene-solr:branch_7_3: SOLR-11960: Don't add property listeners on
core registration
Repository: lucene-solr
Updated Branches:
refs/heads/branch_7_3 80f5162c8 -> 3b8eb6cd3
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/3b8eb6cd
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/3b8eb6cd
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/3b8eb6cd
Branch: refs/heads/branch_7_3
Commit: 3b8eb6cd3e53727812f82711b9aa96d6f511e184
Parents: 80f5162
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:26:53 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/3b8eb6cd/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 cd2de97..f598da8 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
@@ -450,6 +450,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)
@@ -1294,20 +1298,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);
- }
}
/**
@@ -1340,18 +1330,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;
- });
}
/**