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

This commit is contained in:
Jan Høydahl 2016-09-27 12:43:04 +02:00
parent 8046fe29e5
commit 0eaa85f696
2 changed files with 8 additions and 6 deletions

View File

@ -136,7 +136,7 @@ public class ConnectionManager implements Watcher {
} }
do { 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 again to create a new connection.
try { try {
connectionStrategy.reconnect(zkServerAddress, connectionStrategy.reconnect(zkServerAddress,
@ -232,7 +232,7 @@ public class ConnectionManager implements Watcher {
if (!connected) { if (!connected) {
throw new TimeoutException("Could not connect to ZooKeeper " + zkServerAddress + " within " + waitForConnection + " ms"); 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) public synchronized void waitForDisconnected(long timeout)

View File

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