mirror of https://github.com/apache/lucene.git
SOLR-11779: Reduce logging, fix index size conversion bug.
This commit is contained in:
parent
377f16de5e
commit
481a1f859d
|
@ -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.NodeStateProvider;
|
||||||
import org.apache.solr.client.solrj.cloud.SolrCloudManager;
|
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.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.cloud.autoscaling.VersionedData;
|
||||||
import org.apache.solr.client.solrj.impl.HttpClientUtil;
|
import org.apache.solr.client.solrj.impl.HttpClientUtil;
|
||||||
import org.apache.solr.cloud.Overseer;
|
import org.apache.solr.cloud.Overseer;
|
||||||
|
@ -248,7 +247,7 @@ public class MetricsHistoryHandler extends RequestHandlerBase implements Permiss
|
||||||
DocCollection systemColl = clusterState.getCollectionOrNull(CollectionAdminParams.SYSTEM_COLL);
|
DocCollection systemColl = clusterState.getCollectionOrNull(CollectionAdminParams.SYSTEM_COLL);
|
||||||
if (systemColl == null) {
|
if (systemColl == null) {
|
||||||
if (logMissingCollection) {
|
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;
|
logMissingCollection = false;
|
||||||
}
|
}
|
||||||
factory.setPersistent(false);
|
factory.setPersistent(false);
|
||||||
|
@ -262,7 +261,7 @@ public class MetricsHistoryHandler extends RequestHandlerBase implements Permiss
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!ready) {
|
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);
|
factory.setPersistent(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -284,7 +283,7 @@ public class MetricsHistoryHandler extends RequestHandlerBase implements Permiss
|
||||||
logMissingCollection = true;
|
logMissingCollection = true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (logMissingCollection) {
|
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;
|
logMissingCollection = false;
|
||||||
factory.setPersistent(false);
|
factory.setPersistent(false);
|
||||||
|
@ -486,10 +485,6 @@ public class MetricsHistoryHandler extends RequestHandlerBase implements Permiss
|
||||||
replicas.forEach(ri -> {
|
replicas.forEach(ri -> {
|
||||||
collTags.forEach(tag -> {
|
collTags.forEach(tag -> {
|
||||||
double value = ((Number)ri.getVariable(tag, 0.0)).doubleValue();
|
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());
|
DoubleAdder adder = (DoubleAdder)perReg.computeIfAbsent(tag, t -> new DoubleAdder());
|
||||||
adder.add(value);
|
adder.add(value);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue