Class CoreDescriptor


  • public class CoreDescriptor
    extends Object
    A Solr core descriptor
    Since:
    solr 1.3
    • Constructor Detail

      • CoreDescriptor

        public CoreDescriptor​(String name,
                              Path instanceDir,
                              Properties containerProperties,
                              boolean isZooKeeperAware,
                              String... properties)
      • CoreDescriptor

        public CoreDescriptor​(String name,
                              Path instanceDir,
                              Properties containerProperties,
                              boolean isZooKeeperAware)
        Create a new CoreDescriptor with a given name and instancedir
        Parameters:
        name - the CoreDescriptor's name
        instanceDir - the CoreDescriptor's instancedir
        containerProperties - the enclosing container properties for variable resolution
        isZooKeeperAware - whether we are part of SolrCloud or not.
      • CoreDescriptor

        public CoreDescriptor​(String coreName,
                              CoreDescriptor other)
        Create a new CoreDescriptor using the properties of an existing one
        Parameters:
        coreName - the new CoreDescriptor's name
        other - the CoreDescriptor to copy
      • CoreDescriptor

        public CoreDescriptor​(String name,
                              Path instanceDir,
                              Map<String,​String> coreProps,
                              Properties containerProperties,
                              boolean isZooKeeperAware)
        Create a new CoreDescriptor.
        Parameters:
        name - the CoreDescriptor's name
        instanceDir - a Path resolving to the instanceDir
        coreProps - a Map of the properties for this core
        containerProperties - the properties from the enclosing container.
        isZooKeeperAware - if true, we ar in SolrCloud mode.
    • 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 for conf/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()
        Returns:
        the core instance directory
      • getConfigName

        public String getConfigName()
        Returns:
        the core configuration resource name.
      • getSchemaName

        public String getSchemaName()
        Returns:
        the core schema resource name.
      • getName

        public String getName()
        Returns:
        the initial core name
      • setProperty

        public void setProperty​(String prop,
                                String val)
      • getCollectionName

        public String getCollectionName()
      • 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()
      • getConfigSetPropertiesName

        public String getConfigSetPropertiesName()
      • isConfigSetTrusted

        public boolean isConfigSetTrusted()
      • setConfigSetTrusted

        public void setConfigSetTrusted​(boolean trusted)