SOLR-14878: Expose solr.xml's coreRootDirectory property via the System Settings API (#1894)

This commit is contained in:
Alexandre Rafalovitch 2020-09-19 22:07:03 -04:00 committed by GitHub
parent ab3f1f0d1d
commit f6e8bc8c31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -48,6 +48,8 @@ Improvements
* SOLR-14799: JWT authentication plugin only requires "sub" claim when principalClaim=sub. (Erik Hatcher)
* SOLR-14878: Report solr.xml's coreRootDirectory property via System Settings API, when set (Alexandre Rafalovitch)
Other Changes
----------------------
* SOLR-14656: Autoscaling framework removed (Ishan Chattopadhyaya, noble, Ilan Ginzburg)

View File

@ -23,6 +23,7 @@ import java.lang.management.ManagementFactory;
import java.lang.management.OperatingSystemMXBean;
import java.lang.management.RuntimeMXBean;
import java.net.InetAddress;
import java.nio.file.Path;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Date;
@ -139,8 +140,19 @@ public class SystemInfoHandler extends RequestHandlerBase
if (solrCloudMode) {
rsp.add("zkHost", getCoreContainer(req, core).getZkController().getZkServerAddress());
}
if (cc != null)
rsp.add( "solr_home", cc.getSolrHome());
if (cc != null) {
String solrHome = cc.getSolrHome();
rsp.add("solr_home", solrHome);
Path coreRootDirectory = cc.getCoreRootDirectory();
if (coreRootDirectory != null) {
String coreRootDirectoryString = coreRootDirectory.toString();
if (!coreRootDirectoryString.equals(solrHome)) {
rsp.add("solr_core_root", coreRootDirectoryString);
}
}
}
rsp.add( "lucene", getLuceneInfo() );
rsp.add( "jvm", getJvmInfo() );
rsp.add( "security", getSecurityInfo(req) );