org.apache.solr.core
Class CoreDescriptor

java.lang.Object
  extended by org.apache.solr.core.CoreDescriptor

public class CoreDescriptor
extends Object

A Solr core descriptor

Since:
solr 1.3

Field Summary
static String CORE_COLLECTION
           
static String CORE_CONFIG
           
static String CORE_DATADIR
           
static String CORE_INSTDIR
           
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
           
 
Constructor Summary
CoreDescriptor(CoreContainer container, Properties propsIn)
          CoreDescriptor - create a core descriptor given default properties from a core.properties file.
CoreDescriptor(CoreContainer container, String name, String instanceDir)
           
CoreDescriptor(CoreDescriptor descr)
           
 
Method Summary
 String getAbsoluteDataDir()
           
 CloudDescriptor getCloudDescriptor()
           
 String getConfigName()
           
 CoreContainer getCoreContainer()
           
 String getDataDir()
           
 String getDefaultConfigName()
           
 String getDefaultDataDir()
           
 String getDefaultSchemaName()
           
 String getInstanceDir()
           
 String getName()
           
 String getPropertiesName()
           
 String getProperty(String prop)
          gReads a property defined in the core.properties file that's replacing solr.xml (if present).
 String getProperty(String prop, String defVal)
          Reads a property defined in the core.properties file that's replacing solr.xml (if present).
 String getRawInstanceDir()
           
 String getSchemaName()
           
 String getUlogDir()
           
 Properties initImplicitProperties()
           
 boolean isLoadOnStartup()
           
 boolean isTransient()
           
 void putProperty(String prop, String val)
          This will eventually replace _all_ of the setters.
 void setCloudDescriptor(CloudDescriptor cloudDesc)
           
 void setConfigName(String name)
          Sets the core configuration resource name.
 void setCoreProperties(Properties coreProperties)
          Set this core's properties.
 void setDataDir(String s)
           
 void setLoadOnStartup(boolean loadOnStartup)
           
 void setPropertiesName(String propertiesName)
           
 void setSchemaName(String name)
          Sets the core schema resource name.
 void setTransient(boolean isTransient)
           
 void setUlogDir(String ulogDir)
           
 boolean usingDefaultDataDir()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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_INSTDIR

public static final String CORE_INSTDIR
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
Constructor Detail

CoreDescriptor

public CoreDescriptor(CoreContainer container,
                      String name,
                      String instanceDir)

CoreDescriptor

public CoreDescriptor(CoreDescriptor descr)

CoreDescriptor

public CoreDescriptor(CoreContainer container,
                      Properties propsIn)
CoreDescriptor - create a core descriptor given default properties from a core.properties file. This will be used in the "solr.xml-less (See SOLR-4196) world where there are no <core> </core> tags at all, thus much of the initialization that used to be done when reading solr.xml needs to be done here instead, particularly setting any defaults (e.g. schema.xml, directories, whatever).

Parameters:
container - - the CoreContainer that holds all the information about our cores, loaded, lazy etc.
propsIn - - A properties structure "core.properties" found while walking the file tree to discover cores. Any properties set in this param will overwrite the any defaults.
Method Detail

initImplicitProperties

public Properties initImplicitProperties()

getDefaultConfigName

public String getDefaultConfigName()
Returns:
the default config name.

getDefaultSchemaName

public String getDefaultSchemaName()
Returns:
the default schema name.

getDefaultDataDir

public String getDefaultDataDir()
Returns:
the default data directory.

getPropertiesName

public String getPropertiesName()

setPropertiesName

public void setPropertiesName(String propertiesName)

getDataDir

public String getDataDir()

setDataDir

public void setDataDir(String s)

usingDefaultDataDir

public boolean usingDefaultDataDir()

getRawInstanceDir

public String getRawInstanceDir()
Returns:
the core instance directory.

getInstanceDir

public String getInstanceDir()
Returns:
the core instance directory, prepended with solr_home if not an absolute path.

setConfigName

public void setConfigName(String name)
Sets the core configuration resource name.


getConfigName

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

setSchemaName

public void setSchemaName(String name)
Sets the core schema resource name.


getSchemaName

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

getName

public String getName()
Returns:
the initial core name

getCoreContainer

public CoreContainer getCoreContainer()

setCoreProperties

public void setCoreProperties(Properties coreProperties)
Set this core's properties. Please note that some implicit values will be added to the Properties instance passed into this method. This means that the Properties instance sent to this method will have different (less) key/value pairs than the Properties instance returned by #getCoreProperties method. Under any circumstance, the properties passed in will override any already present.Merge


getCloudDescriptor

public CloudDescriptor getCloudDescriptor()

setCloudDescriptor

public void setCloudDescriptor(CloudDescriptor cloudDesc)

isLoadOnStartup

public boolean isLoadOnStartup()

setLoadOnStartup

public void setLoadOnStartup(boolean loadOnStartup)

isTransient

public boolean isTransient()

setTransient

public void setTransient(boolean isTransient)

getUlogDir

public String getUlogDir()

setUlogDir

public void setUlogDir(String ulogDir)

getProperty

public String getProperty(String prop,
                          String defVal)
Reads a property defined in the core.properties file that's replacing solr.xml (if present).

Parameters:
prop - - value to read from the properties structure.
defVal - - return if no property found.
Returns:
associated string. May be null.

getProperty

public String getProperty(String prop)
gReads a property defined in the core.properties file that's replacing solr.xml (if present).

Parameters:
prop - value to read from the properties structure.
Returns:
associated string. May be null.

putProperty

public void putProperty(String prop,
                        String val)
This will eventually replace _all_ of the setters. Puts a value in the "new" (obsoleting solr.xml JIRAs) properties structures. Will replace any currently-existing property with the key "prop".

Parameters:
prop - - property name
val - - property value

getAbsoluteDataDir

public String getAbsoluteDataDir()


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.