log less often than twice a second

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1416058 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-12-01 21:51:20 +00:00
parent 228fb5669f
commit 317931ee5f
1 changed files with 5 additions and 2 deletions

View File

@ -293,7 +293,7 @@ final class ShardLeaderElectionContext extends ShardLeaderElectionContextBase {
final String shardsElectZkPath = electionPath + LeaderElector.ELECTION_NODE;
Slice slices = zkController.getClusterState().getSlice(collection, shardId);
int cnt = 0;
while (true && !isClosed) {
// wait for everyone to be up
if (slices != null) {
@ -310,9 +310,11 @@ final class ShardLeaderElectionContext extends ShardLeaderElectionContextBase {
log.info("Enough replicas found to continue.");
return;
} else {
log.info("Waiting until we see more replicas up: total="
if (cnt % 40 == 0) {
log.info("Waiting until we see more replicas up: total="
+ slices.getReplicasMap().size() + " found=" + found
+ " timeoutin=" + (timeoutAt - System.currentTimeMillis()));
}
}
if (System.currentTimeMillis() > timeoutAt) {
@ -324,6 +326,7 @@ final class ShardLeaderElectionContext extends ShardLeaderElectionContextBase {
Thread.sleep(500);
slices = zkController.getClusterState().getSlice(collection, shardId);
// System.out.println("###### waitForReplicasToComeUp : slices=" + slices + " all=" + zkController.getClusterState().getCollectionStates() );
cnt++;
}
}