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

This commit is contained in:
Tomas Fernandez Lobbe 2018-03-15 12:21:20 -07:00
parent d50890e925
commit 67dab22f29
1 changed files with 4 additions and 26 deletions

View File

@ -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;
});
}
/**