SOLR-6924: removing double listening of nodes

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1669245 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2015-03-26 00:33:49 +00:00
parent ed325dc91c
commit 0656e8ac44
1 changed files with 3 additions and 3 deletions

View File

@ -2295,9 +2295,9 @@ public final class ZkController {
private final Map<String, Set<Runnable>> confDirectoryListeners = new HashMap<>();
void watchZKConfDir(final String zkDir) {
log.info("watch zkdir " + zkDir);
log.info("watch zkdir {}" , zkDir);
if (!confDirectoryListeners.containsKey(zkDir)) {
confDirectoryListeners.put(zkDir, new HashSet<Runnable>());
confDirectoryListeners.put(zkDir, new HashSet<>());
setConfWatcher(zkDir, new WatcherImpl(zkDir), null);
}
}
@ -2348,6 +2348,7 @@ public final class ZkController {
new Thread() {
//run these in a separate thread because this can be long running
public void run() {
log.info("Running listeners for {}", zkDir);
for (final Runnable listener : listenersCopy) {
try {
listener.run();
@ -2371,7 +2372,6 @@ public final class ZkController {
//so fire the event listeners
fireEventListeners(zkDir);
}
zkClient.exists(zkDir, watcher, true);
} catch (KeeperException e) {
log.error("failed to set watcher for conf dir {} ", zkDir);
} catch (InterruptedException e) {