Package org.apache.solr.core
Class CoreDescriptor
java.lang.Object
org.apache.solr.core.CoreDescriptor
Metadata about a
SolrCore. It's mostly loaded from a file on disk at the very beginning
of loading a core.
It's mostly but not completely immutable; we should fix this!
- Since:
- solr 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected final PropertiesThe properties for this core, as available through getProperty()protected final PropertiesThe original standard core properties, before substitutionprotected final PropertiesThe original extra core properties, before substitutionstatic final Stringprotected final PropertiesThe properties for this core, substitutable by resource loaders -
Constructor Summary
ConstructorsConstructorDescriptionCoreDescriptor(String name, Path instanceDir, Map<String, String> coreProps, Properties containerProperties, ZkController zkController) Create a new CoreDescriptor.CoreDescriptor(String name, Path instanceDir, CoreContainer coreContainer, String... coreProps) TESTS ONLYCoreDescriptor(String coreName, CoreDescriptor other) Create a new CoreDescriptor using the properties of an existing one -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCreate the properties object used by resource loaders, etc., for property substitution.static StringcheckPropertyIsNotEmpty(String value, String propName) getCoreProperty(String prop, String defVal) Returns a specific property defined on this CoreDescriptorThe core instance directory (absolute).getName()Get the standard properties in persistable formGet user-defined core properties in persistable formReturns all substitutable properties defined on this CoreDescriptorbooleanprotected static booleanisUserDefinedProperty(String propName) Is this property a Solr-standard property, or is it an extra property defined per-core by the user?protected voidLoad properties specified in an external properties file.voidsetConfigSet(String configSetName) TODO remove mutability or at least make this non-public?toString()boolean
-
Field Details
-
CORE_NAME
- See Also:
-
CORE_CONFIG
- See Also:
-
CORE_DATADIR
- See Also:
-
CORE_ULOGDIR
- See Also:
-
CORE_SCHEMA
- See Also:
-
CORE_SHARD
- See Also:
-
CORE_COLLECTION
- See Also:
-
CORE_PROPERTIES
- See Also:
-
CORE_LOADONSTARTUP
- See Also:
-
CORE_NODE_NAME
- See Also:
-
CORE_CONFIGSET
- See Also:
-
CORE_CONFIGSET_PROPERTIES
- See Also:
-
SOLR_CORE_PROP_PREFIX
- See Also:
-
standardPropNames
-
originalCoreProperties
The original standard core properties, before substitution -
originalExtraProperties
The original extra core properties, before substitution -
coreProperties
The properties for this core, as available through getProperty() -
substitutableProperties
The properties for this core, substitutable by resource loaders
-
-
Constructor Details
-
CoreDescriptor
public CoreDescriptor(String name, Path instanceDir, CoreContainer coreContainer, String... coreProps) TESTS ONLY -
CoreDescriptor
Create a new CoreDescriptor using the properties of an existing one- Parameters:
coreName- the new CoreDescriptor's nameother- the CoreDescriptor to copy
-
CoreDescriptor
public CoreDescriptor(String name, Path instanceDir, Map<String, String> coreProps, Properties containerProperties, ZkController zkController) Create a new CoreDescriptor.- Parameters:
name- the CoreDescriptor's nameinstanceDir- a Path resolving to the instanceDir. Must be absolute.coreProps- a Map of the properties for this corecontainerProperties- the properties from the enclosing container.zkController- the ZkController in SolrCloud mode, otherwise null.
-
-
Method Details
-
getPersistableStandardProperties
Get the standard properties in persistable form- Returns:
- the standard core properties in persistable form
-
getPersistableUserProperties
Get user-defined core properties in persistable form- Returns:
- user-defined core properties in persistable form
-
loadExtraProperties
protected void loadExtraProperties()Load properties specified in an external properties file.The file to load is specified in a
propertiesproperty on the original Properties object used to create this CoreDescriptor.File paths are taken as read from the core's instance directory if they are not absolute.
-
buildSubstitutableProperties
protected void buildSubstitutableProperties()Create the properties object used by resource loaders, etc., for property substitution. The default solr properties are prefixed with 'solr.core.', so, e.g., 'name' becomes 'solr.core.name' -
isUserDefinedProperty
Is this property a Solr-standard property, or is it an extra property defined per-core by the user?- Parameters:
propName- the Property name- Returns:
trueif this property is user-defined
-
checkPropertyIsNotEmpty
-
getPropertiesName
-
getDataDir
-
usingDefaultDataDir
public boolean usingDefaultDataDir() -
getInstanceDir
The core instance directory (absolute). -
getConfigName
- Returns:
- the core configuration resource name.
-
getSchemaName
- Returns:
- the core schema resource name. Not actually used if schema is managed mode.
-
getName
- Returns:
- the initial core name
-
getCollectionName
-
getCloudDescriptor
-
isLoadOnStartup
public boolean isLoadOnStartup() -
getUlogDir
-
getCoreProperty
Returns a specific property defined on this CoreDescriptor- Parameters:
prop- - value to read from the properties structure.defVal- - return if no property found.- Returns:
- associated string. May be null.
-
getSubstitutableProperties
Returns all substitutable properties defined on this CoreDescriptor- Returns:
- all substitutable properties defined on this CoreDescriptor
-
toString
-
getConfigSet
-
setConfigSet
TODO remove mutability or at least make this non-public? -
getConfigSetPropertiesName
-