Package org.apache.solr.handler.admin
Class SolrEnvironment
java.lang.Object
org.apache.solr.handler.admin.SolrEnvironment
It is possible to define an environment code when starting Solr, through
-Dsolr.environment=prod|stage|test|dev or by setting the cluster property "environment". This
class checks if any of these are defined, and parses the string, which may also contain custom
overrides for environment name (label) and color to be shown in Admin UI
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCode()getColor()static SolrEnvironmentgetFromSyspropOrClusterprop(org.apache.solr.common.cloud.ZkStateReader zkStateReader) Gets and parses the solr environment configuration string from either System properties "solr.environment" or from Clusterprop "environment"getLabel()booleanstatic SolrEnvironmentParse an environment string of format <prod|stage|test|dev> with an optional label and color as arguments
-
Constructor Details
-
SolrEnvironment
public SolrEnvironment()
-
-
Method Details
-
getCode
-
getLabel
-
getColor
-
isDefined
public boolean isDefined() -
parse
Parse an environment string of format <prod|stage|test|dev> with an optional label and color as arguments- Parameters:
environmentString- the raw string to parse- Returns:
- an instance of this object
-
getFromSyspropOrClusterprop
public static SolrEnvironment getFromSyspropOrClusterprop(org.apache.solr.common.cloud.ZkStateReader zkStateReader) Gets and parses the solr environment configuration string from either System properties "solr.environment" or from Clusterprop "environment"- Parameters:
zkStateReader- pass in the zkStateReader if in cloud mode- Returns:
- an instance of this class
-