Apache Solr open-source search software
SOLR-17864: Migrate System Properties (#3618)
Eric Pugh2a1da0ae829b
diff --git a/solr/core/src/java/org/apache/solr/core/TracerConfigurator.java b/solr/core/src/java/org/apache/solr/core/TracerConfigurator.javaindex bf4c13f7198..5d386701c6f 100644--- a/solr/core/src/java/org/apache/solr/core/TracerConfigurator.java+++ b/solr/core/src/java/org/apache/solr/core/TracerConfigurator.java@@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;public abstract class TracerConfigurator implements NamedListInitializedPlugin {public static final boolean TRACE_ID_GEN_ENABLED =- Boolean.parseBoolean(EnvUtils.getProperty("solr.alwaysOnTraceId", "true"));+ EnvUtils.getPropertyAsBool("solr.tracing.always.on.enabled", true);private static final String DEFAULT_CLASS_NAME =EnvUtils.getProperty(diff --git a/solr/core/src/java/org/apache/solr/core/ZkContainer.java b/solr/core/src/java/org/apache/solr/core/ZkContainer.javaindex f6e27ffdaf5..4077255f6a1 100644--- a/solr/core/src/java/org/apache/solr/core/ZkContainer.java+++ b/solr/core/src/java/org/apache/solr/core/ZkContainer.java@@ -33,6 +33,7 @@ import org.apache.solr.common.cloud.ClusterProperties;import org.apache.solr.common.cloud.Replica;import org.apache.solr.common.cloud.ZkStateReader;import org.apache.solr.common.cloud.ZooKeeperException;+import org.apache.solr.common.util.EnvUtils;import org.apache.solr.common.util.ExecutorUtil;import org.apache.solr.common.util.SolrNamedThreadFactory;import org.apache.solr.common.util.StrUtils;@@ -120,7 +121,7 @@ public class ZkContainer {} else {log.info("Zookeeper client={}", zookeeperHost);}- boolean createRoot = Boolean.getBoolean("createZkChroot");+ boolean createRoot = EnvUtils.getPropertyAsBool("solr.zookeeper.chroot.create", false);if (!ZkController.checkChrootPath(zookeeperHost, zkRunOnly || createRoot)) {throw new ZooKeeperException(diff --git a/solr/core/src/java/org/apache/solr/search/SolrFieldCacheBean.java b/solr/core/src/java/org/apache/solr/search/SolrFieldCacheBean.javaindex 85be7c8bf3d..8d0755f159d 100644--- a/solr/core/src/java/org/apache/solr/search/SolrFieldCacheBean.java+++ b/solr/core/src/java/org/apache/solr/search/SolrFieldCacheBean.java@@ -16,6 +16,7 @@*/package org.apache.solr.search;+import org.apache.solr.common.util.EnvUtils;import org.apache.solr.core.SolrInfoBean;import org.apache.solr.metrics.MetricsMap;import org.apache.solr.metrics.SolrMetricsContext;@@ -24,9 +25,10 @@ import org.apache.solr.uninverting.UninvertingReader;/** A SolrInfoBean that provides introspection of the Solr FieldCache */public class SolrFieldCacheBean implements SolrInfoBean {- private boolean disableEntryList = Boolean.getBoolean("disableSolrFieldCacheMBeanEntryList");- private boolean disableJmxEntryList =- Boolean.getBoolean("disableSolrFieldCacheMBeanEntryListJmx");+ private boolean enableEntryList =+ EnvUtils.getPropertyAsBool("solr.metrics.fieldcache.entries.enabled", true);+ private boolean enableJmxEntryList =+ EnvUtils.getPropertyAsBool("solr.metrics.fieldcache.entries.jmx.enabled", true);private SolrMetricsContext solrMetricsContext;@@ -56,7 +58,7 @@ public class SolrFieldCacheBean implements SolrInfoBean {MetricsMap metricsMap =new MetricsMap(map -> {- if (!disableEntryList && !disableJmxEntryList) {+ if (enableEntryList && enableJmxEntryList) {UninvertingReader.FieldCacheStats fieldCacheStats =UninvertingReader.getUninvertedStats();String[] entries = fieldCacheStats.info;diff --git a/solr/core/src/test/org/apache/solr/search/TestSolrFieldCacheBean.java b/solr/core/src/test/org/apache/solr/search/TestSolrFieldCacheBean.javaindex 3d99bca59c2..4aeb4da7c36 100644--- a/solr/core/src/test/org/apache/solr/search/TestSolrFieldCacheBean.java+++ b/solr/core/src/test/org/apache/solr/search/TestSolrFieldCacheBean.java@@ -44,22 +44,22 @@ public class TestSolrFieldCacheBean extends SolrTestCaseJ4 {assertEntryListIncluded(false);// Test again with entry list disabled- System.setProperty("disableSolrFieldCacheMBeanEntryList", "true");+ System.setProperty("solr.metrics.fieldcache.entries.enabled", "false");try {assertEntryListNotIncluded(false);} finally {- System.clearProperty("disableSolrFieldCacheMBeanEntryList");+ System.clearProperty("solr.metrics.fieldcache.entries.enabled");}// Test with entry list enabled for jmxassertEntryListIncluded(true);// Test with entry list disabled for jmx- System.setProperty("disableSolrFieldCacheMBeanEntryListJmx", "true");+ System.setProperty("solr.metrics.fieldcache.entries.jmx.enabled", "false");try {assertEntryListNotIncluded(true);} finally {- System.clearProperty("disableSolrFieldCacheMBeanEntryListJmx");+ System.clearProperty("solr.metrics.fieldcache.entries.jmx.enabled");}}diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/distributed-tracing.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/distributed-tracing.adocindex 92fe6c894a1..fb4cdb050cc 100644--- a/solr/solr-ref-guide/modules/deployment-guide/pages/distributed-tracing.adoc+++ b/solr/solr-ref-guide/modules/deployment-guide/pages/distributed-tracing.adoc@@ -32,7 +32,7 @@ Solr includes an always-on trace id generator. This will inject trace id headersThe header name it uses for propagation is `X-Trace-Id`, this can be changed by updating the system property `solr.traceIdHeader`.This plugin will not be enabled if another Tracing mechanism is setup via Solr config.-This plugin can be disabled by setting the `solr.alwaysOnTraceId` system property to `false`.+This plugin can be disabled by setting the `solr.tracing.always.on.enabled` system property to `false`.== Modules and Configurationdiff --git a/solr/solr-ref-guide/modules/query-guide/pages/stream-source-reference.adoc b/solr/solr-ref-guide/modules/query-guide/pages/stream-source-reference.adocindex 07c79689daa..0f39d3a812b 100644--- a/solr/solr-ref-guide/modules/query-guide/pages/stream-source-reference.adoc+++ b/solr/solr-ref-guide/modules/query-guide/pages/stream-source-reference.adoc@@ -146,7 +146,7 @@ The `per` metric calculates a percentilefor a numeric column and can be specified multiple times in the same facet function.* `tiered`: (Default true) Flag governing whether the `facet` stream should parallelize JSON Facet requests to multiple Solr collections using a `plist` expression; this option only applies if the `collection` is an alias backed by multiple collections.If `tiered` is enabled, then a `rollup` expression is used internally to aggregate the metrics from multiple `facet` expressions into a single result; only `count`, `min`, `max`, `sum`, and `avg` metrics are supported.-Client applications can disable this globally by setting the `solr.facet.stream.tiered=false` system property.+Client applications can disable this globally by setting the `solr.streamingexpressions.facet.tiered.enabled=false` system property.=== facet Syntaxdiff --git a/solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.java b/solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.javaindex 68343b5f0e1..f1bb705820f 100644--- a/solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.java+++ b/solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.java@@ -49,6 +49,7 @@ import org.apache.solr.client.solrj.request.QueryRequest;import org.apache.solr.common.params.ModifiableSolrParams;import org.apache.solr.common.params.SolrParams;import org.apache.solr.common.util.CollectionUtil;+import org.apache.solr.common.util.EnvUtils;import org.apache.solr.common.util.NamedList;/**@@ -64,7 +65,7 @@ public class FacetStream extends TupleStream implements Expressible, ParallelMet// allow client apps to disable the auto-plist via system property if they want to turn it off// globallystatic final boolean defaultTieredEnabled =- Boolean.parseBoolean(System.getProperty("solr.facet.stream.tiered", "true"));+ EnvUtils.getPropertyAsBool("solr.streamingexpressions.facet.tiered.enabled", true);static final String TIERED_PARAM = "tiered";diff --git a/solr/solrj/src/resources/DeprecatedSystemPropertyMappings.properties b/solr/solrj/src/resources/DeprecatedSystemPropertyMappings.propertiesindex 230d75f6582..05fb16c227e 100644--- a/solr/solrj/src/resources/DeprecatedSystemPropertyMappings.properties+++ b/solr/solrj/src/resources/DeprecatedSystemPropertyMappings.properties@@ -24,6 +24,9 @@ solr.filestore.filesize.max=max.file.store.sizesolr.logs.dir=solr.log.dir+solr.metrics.fieldcache.entries.enabled=!disable.solr.field.cache.m.bean.entry.list+solr.metrics.fieldcache.entries.jmx.enabled=!disable.solr.field.cache.m.bean.entry.list.jmx+solr.packages.enabled=enable.packagessolr.requests.streaming.body.enabled=solr.enable.stream.bodysolr.requests.streaming.remote.enabled=solr.enable.remote.streaming@@ -38,5 +41,11 @@ solr.security.auth.plugin=authentication.pluginsolr.solrj.cloud.max.stale.retries=cloud.solr.client.max.stale.retries+solr.streamingexpressions.facet.tiered.enabled=solr.facet.stream.tiered++solr.tracing.always.on.enabled=solr.always.on.trace.id+solr.ui.enabled=!solr.admin.ui.disabledsolr.ui.experimental.enabled=!solr.admin.ui.experimental.disabled++solr.zookeeper.chroot.create=create.zk.chroot