Package org.apache.solr.core
Class CoreDescriptor
- java.lang.Object
 - 
- org.apache.solr.core.CoreDescriptor
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static StringCORE_COLLECTIONstatic StringCORE_CONFIGstatic StringCORE_CONFIGSETstatic StringCORE_CONFIGSET_PROPERTIESstatic StringCORE_DATADIRstatic StringCORE_LOADONSTARTUPstatic StringCORE_NAMEstatic StringCORE_NODE_NAMEstatic StringCORE_PROPERTIESstatic StringCORE_ROLESstatic StringCORE_SCHEMAstatic StringCORE_SHARDstatic StringCORE_TRANSIENTstatic StringCORE_ULOGDIRprotected PropertiescorePropertiesThe properties for this core, as available through getProperty()static StringDEFAULT_EXTERNAL_PROPERTIES_FILEprotected PropertiesoriginalCorePropertiesThe original standard core properties, before substitutionprotected PropertiesoriginalExtraPropertiesThe original extra core properties, before substitutionstatic StringSOLR_CORE_PROP_PREFIXstatic List<String>standardPropNamesprotected PropertiessubstitutablePropertiesThe properties for this core, substitutable by resource loaders 
- 
Constructor Summary
Constructors Constructor Description CoreDescriptor(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbuildSubstitutableProperties()Create the properties object used by resource loaders, etc., for property substitution.static StringcheckPropertyIsNotEmpty(String value, String propName)CloudDescriptorgetCloudDescriptor()StringgetCollectionName()StringgetConfigName()StringgetConfigSet()StringgetConfigSetPropertiesName()StringgetCoreProperty(String prop, String defVal)Returns a specific property defined on this CoreDescriptorStringgetDataDir()PathgetInstanceDir()The core instance directory (absolute).StringgetName()PropertiesgetPersistableStandardProperties()Get the standard properties in persistable formPropertiesgetPersistableUserProperties()Get user-defined core properties in persistable formStringgetPropertiesName()StringgetSchemaName()PropertiesgetSubstitutableProperties()Returns all substitutable properties defined on this CoreDescriptorStringgetUlogDir()booleanisConfigSetTrusted()booleanisLoadOnStartup()booleanisTransient()protected static booleanisUserDefinedProperty(String propName)Is this property a Solr-standard property, or is it an extra property defined per-core by the user?protected voidloadExtraProperties()Load properties specified in an external properties file.voidsetConfigSet(String configSetName)TODO remove mutability or at least make this non-public?voidsetConfigSetTrusted(boolean trusted)TODO remove mutabilityStringtoString()booleanusingDefaultDataDir() 
 - 
 
- 
- 
Field Detail
- 
CORE_NAME
public static final String CORE_NAME
- See Also:
 - Constant Field Values
 
 
- 
CORE_CONFIG
public static final String CORE_CONFIG
- See Also:
 - Constant Field Values
 
 
- 
CORE_DATADIR
public static final String CORE_DATADIR
- See Also:
 - Constant Field Values
 
 
- 
CORE_ULOGDIR
public static final String CORE_ULOGDIR
- See Also:
 - Constant Field Values
 
 
- 
CORE_SCHEMA
public static final String CORE_SCHEMA
- See Also:
 - Constant Field Values
 
 
- 
CORE_SHARD
public static final String CORE_SHARD
- See Also:
 - Constant Field Values
 
 
- 
CORE_COLLECTION
public static final String CORE_COLLECTION
- See Also:
 - Constant Field Values
 
 
- 
CORE_ROLES
public static final String CORE_ROLES
- See Also:
 - Constant Field Values
 
 
- 
CORE_PROPERTIES
public static final String CORE_PROPERTIES
- See Also:
 - Constant Field Values
 
 
- 
CORE_LOADONSTARTUP
public static final String CORE_LOADONSTARTUP
- See Also:
 - Constant Field Values
 
 
- 
CORE_TRANSIENT
public static final String CORE_TRANSIENT
- See Also:
 - Constant Field Values
 
 
- 
CORE_NODE_NAME
public static final String CORE_NODE_NAME
- See Also:
 - Constant Field Values
 
 
- 
CORE_CONFIGSET
public static final String CORE_CONFIGSET
- See Also:
 - Constant Field Values
 
 
- 
CORE_CONFIGSET_PROPERTIES
public static final String CORE_CONFIGSET_PROPERTIES
- See Also:
 - Constant Field Values
 
 
- 
SOLR_CORE_PROP_PREFIX
public static final String SOLR_CORE_PROP_PREFIX
- See Also:
 - Constant Field Values
 
 
- 
DEFAULT_EXTERNAL_PROPERTIES_FILE
public static final String DEFAULT_EXTERNAL_PROPERTIES_FILE
 
- 
originalCoreProperties
protected final Properties originalCoreProperties
The original standard core properties, before substitution 
- 
originalExtraProperties
protected final Properties originalExtraProperties
The original extra core properties, before substitution 
- 
coreProperties
protected final Properties coreProperties
The properties for this core, as available through getProperty() 
- 
substitutableProperties
protected final Properties substitutableProperties
The properties for this core, substitutable by resource loaders 
 - 
 
- 
Constructor Detail
- 
CoreDescriptor
public CoreDescriptor(String name, Path instanceDir, CoreContainer coreContainer, String... coreProps)
TESTS ONLY 
- 
CoreDescriptor
public CoreDescriptor(String coreName, CoreDescriptor other)
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 Detail
- 
getPersistableStandardProperties
public Properties getPersistableStandardProperties()
Get the standard properties in persistable form- Returns:
 - the standard core properties in persistable form
 
 
- 
getPersistableUserProperties
public Properties 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 can be specified in a
propertiesproperty on the original Properties object used to create this CoreDescriptor. If this has not been set, then we look forconf/solrcore.propertiesunderneath the instance dir.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
protected static boolean isUserDefinedProperty(String propName)
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
public static String checkPropertyIsNotEmpty(String value, String propName)
 
- 
getPropertiesName
public String getPropertiesName()
 
- 
getDataDir
public String getDataDir()
 
- 
usingDefaultDataDir
public boolean usingDefaultDataDir()
 
- 
getInstanceDir
public Path getInstanceDir()
The core instance directory (absolute). 
- 
getConfigName
public String getConfigName()
- Returns:
 - the core configuration resource name.
 
 
- 
getSchemaName
public String getSchemaName()
- Returns:
 - the core schema resource name. Not actually used if schema is managed mode.
 
 
- 
getName
public String getName()
- Returns:
 - the initial core name
 
 
- 
getCollectionName
public String getCollectionName()
 
- 
getCloudDescriptor
public CloudDescriptor getCloudDescriptor()
 
- 
isLoadOnStartup
public boolean isLoadOnStartup()
 
- 
isTransient
public boolean isTransient()
 
- 
getUlogDir
public String getUlogDir()
 
- 
getCoreProperty
public String getCoreProperty(String prop, String defVal)
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
public Properties getSubstitutableProperties()
Returns all substitutable properties defined on this CoreDescriptor- Returns:
 - all substitutable properties defined on this CoreDescriptor
 
 
- 
getConfigSet
public String getConfigSet()
 
- 
setConfigSet
public void setConfigSet(String configSetName)
TODO remove mutability or at least make this non-public? 
- 
getConfigSetPropertiesName
public String getConfigSetPropertiesName()
 
- 
isConfigSetTrusted
public boolean isConfigSetTrusted()
 
- 
setConfigSetTrusted
public void setConfigSetTrusted(boolean trusted)
TODO remove mutability 
 - 
 
 -