SOLR-11779: Reduce logging, fix index size conversion bug.

This commit is contained in:
Andrzej Bialecki 2018-06-13 19:44:55 +02:00
parent 377f16de5e
commit 481a1f859d
1 changed files with 3 additions and 8 deletions

View File

@ -60,7 +60,6 @@ import org.apache.solr.client.solrj.SolrRequest;
import org.apache.solr.client.solrj.cloud.NodeStateProvider;
import org.apache.solr.client.solrj.cloud.SolrCloudManager;
import org.apache.solr.client.solrj.cloud.autoscaling.ReplicaInfo;
import org.apache.solr.client.solrj.cloud.autoscaling.Suggestion;
import org.apache.solr.client.solrj.cloud.autoscaling.VersionedData;
import org.apache.solr.client.solrj.impl.HttpClientUtil;
import org.apache.solr.cloud.Overseer;
@ -248,7 +247,7 @@ public class MetricsHistoryHandler extends RequestHandlerBase implements Permiss
DocCollection systemColl = clusterState.getCollectionOrNull(CollectionAdminParams.SYSTEM_COLL);
if (systemColl == null) {
if (logMissingCollection) {
log.warn("Missing " + CollectionAdminParams.SYSTEM_COLL + ", keeping metrics history in memory");
log.info("No " + CollectionAdminParams.SYSTEM_COLL + " collection, keeping metrics history in memory.");
logMissingCollection = false;
}
factory.setPersistent(false);
@ -262,7 +261,7 @@ public class MetricsHistoryHandler extends RequestHandlerBase implements Permiss
}
}
if (!ready) {
log.debug(CollectionAdminParams.SYSTEM_COLL + " not ready yet, keeping metrics history in memory");
log.debug(CollectionAdminParams.SYSTEM_COLL + "collection not ready yet, keeping metrics history in memory");
factory.setPersistent(false);
return;
}
@ -284,7 +283,7 @@ public class MetricsHistoryHandler extends RequestHandlerBase implements Permiss
logMissingCollection = true;
} catch (Exception e) {
if (logMissingCollection) {
log.warn("Error querying .system collection, keeping metrics history in memory", e);
log.info("No " + CollectionAdminParams.SYSTEM_COLL + " collection, keeping metrics history in memory.");
}
logMissingCollection = false;
factory.setPersistent(false);
@ -486,10 +485,6 @@ public class MetricsHistoryHandler extends RequestHandlerBase implements Permiss
replicas.forEach(ri -> {
collTags.forEach(tag -> {
double value = ((Number)ri.getVariable(tag, 0.0)).doubleValue();
// TODO: fix this when Suggestion.Condition.DISK_IDX uses proper conversion
if (tag.contains(Suggestion.coreidxsize)) {
value = value * 1024.0 * 1024.0 * 1024.0;
}
DoubleAdder adder = (DoubleAdder)perReg.computeIfAbsent(tag, t -> new DoubleAdder());
adder.add(value);
});