SOLR-6677: part 3, moving some more to DEBUG. Only printing "Updated live nodes from ZooKeeper..." if there was actually a change

(cherry picked from commit 0eaa85f)
This commit is contained in:
Jan Høydahl 2016-09-27 12:43:04 +02:00
parent 53fcc7563c
commit 1ac2b01594
2 changed files with 8 additions and 6 deletions

View File

@ -136,7 +136,7 @@ public class ConnectionManager implements Watcher {
}
do {
// This loop will break iff a valid connection is made. If a connection is not made then it will repeat and
// This loop will break if a valid connection is made. If a connection is not made then it will repeat and
// try again to create a new connection.
try {
connectionStrategy.reconnect(zkServerAddress,
@ -232,7 +232,7 @@ public class ConnectionManager implements Watcher {
if (!connected) {
throw new TimeoutException("Could not connect to ZooKeeper " + zkServerAddress + " within " + waitForConnection + " ms");
}
log.info("Client is connected to ZooKeeper");
log.debug("Client is connected to ZooKeeper");
}
public synchronized void waitForDisconnected(long timeout)

View File

@ -368,7 +368,7 @@ public class ZkStateReader implements Closeable {
InterruptedException {
// We need to fetch the current cluster state and the set of live nodes
LOG.info("Updating cluster state from ZooKeeper... ");
LOG.debug("Updating cluster state from ZooKeeper... ");
// Sanity check ZK structure.
if (!zkClient.exists(CLUSTER_STATE, true)) {
@ -397,7 +397,7 @@ public class ZkStateReader implements Closeable {
}
try {
synchronized (ZkStateReader.this.getUpdateLock()) {
LOG.info("Updating aliases... ");
LOG.debug("Updating aliases... ");
// remake watch
final Watcher thisWatch = this;
@ -447,7 +447,7 @@ public class ZkStateReader implements Closeable {
}
try {
synchronized (ZkStateReader.this.getUpdateLock()) {
LOG.info("Updating [{}] ... ", SOLR_SECURITY_CONF_PATH);
LOG.debug("Updating [{}] ... ", SOLR_SECURITY_CONF_PATH);
// remake watch
final Watcher thisWatch = this;
@ -683,7 +683,9 @@ public class ZkStateReader implements Closeable {
clusterState.setLiveNodes(newLiveNodes);
}
}
LOG.info("Updated live nodes from ZooKeeper... ({}) -> ({})", oldLiveNodes.size(), newLiveNodes.size());
if (oldLiveNodes.size() != newLiveNodes.size()) {
LOG.info("Updated live nodes from ZooKeeper... ({}) -> ({})", oldLiveNodes.size(), newLiveNodes.size());
}
if (LOG.isDebugEnabled()) {
LOG.debug("Updated live nodes from ZooKeeper... {} -> {}", new TreeSet<>(oldLiveNodes), new TreeSet<>(newLiveNodes));
}