From 481a1f859d0e9c844113c7693424c6aca1fa5245 Mon Sep 17 00:00:00 2001 From: Andrzej Bialecki Date: Wed, 13 Jun 2018 19:44:55 +0200 Subject: [PATCH] SOLR-11779: Reduce logging, fix index size conversion bug. --- .../solr/handler/admin/MetricsHistoryHandler.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/handler/admin/MetricsHistoryHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/MetricsHistoryHandler.java index 03b545f6f8b..419f021c963 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/MetricsHistoryHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/MetricsHistoryHandler.java @@ -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); });