Package org.apache.solr.core
Class CoreDescriptor
- java.lang.Object
-
- org.apache.solr.core.CoreDescriptor
-
-
Field Summary
Fields Modifier and Type Field Description static String
CORE_COLLECTION
static String
CORE_CONFIG
static String
CORE_CONFIGSET
static String
CORE_CONFIGSET_PROPERTIES
static String
CORE_DATADIR
static String
CORE_LOADONSTARTUP
static String
CORE_NAME
static String
CORE_NODE_NAME
static String
CORE_PROPERTIES
static String
CORE_ROLES
static String
CORE_SCHEMA
static String
CORE_SHARD
static String
CORE_TRANSIENT
static String
CORE_ULOGDIR
protected Properties
coreProperties
The properties for this core, as available through getProperty()static String
DEFAULT_EXTERNAL_PROPERTIES_FILE
protected Properties
originalCoreProperties
The original standard core properties, before substitutionprotected Properties
originalExtraProperties
The original extra core properties, before substitutionstatic String
SOLR_CORE_PROP_PREFIX
static List<String>
standardPropNames
protected Properties
substitutableProperties
The 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 void
buildSubstitutableProperties()
Create the properties object used by resource loaders, etc., for property substitution.static String
checkPropertyIsNotEmpty(String value, String propName)
CloudDescriptor
getCloudDescriptor()
String
getCollectionName()
String
getConfigName()
String
getConfigSet()
String
getConfigSetPropertiesName()
String
getCoreProperty(String prop, String defVal)
Returns a specific property defined on this CoreDescriptorString
getDataDir()
Path
getInstanceDir()
The core instance directory (absolute).String
getName()
Properties
getPersistableStandardProperties()
Get the standard properties in persistable formProperties
getPersistableUserProperties()
Get user-defined core properties in persistable formString
getPropertiesName()
String
getSchemaName()
Properties
getSubstitutableProperties()
Returns all substitutable properties defined on this CoreDescriptorString
getUlogDir()
boolean
isConfigSetTrusted()
boolean
isLoadOnStartup()
boolean
isTransient()
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?protected void
loadExtraProperties()
Load properties specified in an external properties file.void
setConfigSet(String configSetName)
TODO remove mutability or at least make this non-public?void
setConfigSetTrusted(boolean trusted)
TODO remove mutabilityString
toString()
boolean
usingDefaultDataDir()
-
-
-
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
properties
property on the original Properties object used to create this CoreDescriptor. If this has not been set, then we look forconf/solrcore.properties
underneath 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:
true
if 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
-
-