|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.solr.core.CoreContainer
public class CoreContainer
Nested Class Summary | |
---|---|
static class |
CoreContainer.Initializer
|
Field Summary | |
---|---|
protected WeakReference<SolrCore> |
adminCore
|
protected String |
adminHandler
|
protected String |
adminPath
|
protected File |
configFile
|
protected Properties |
containerProperties
|
protected CoreAdminHandler |
coreAdminHandler
|
protected Map<String,SolrCore> |
cores
|
protected Map<String,IndexSchema> |
indexSchemaCache
|
protected String |
libDir
|
protected ClassLoader |
libLoader
|
protected SolrResourceLoader |
loader
|
protected static org.slf4j.Logger |
log
|
protected String |
managementPath
|
protected boolean |
persistent
|
protected boolean |
shareSchema
|
protected String |
solrHome
|
Constructor Summary | |
---|---|
CoreContainer()
|
|
CoreContainer(SolrResourceLoader loader)
Minimal CoreContainer constructor. |
|
CoreContainer(String solrHome)
|
|
CoreContainer(String dir,
File configFile)
Initalize CoreContainer directly from the constructor |
Method Summary | |
---|---|
SolrCore |
create(CoreDescriptor dcore)
Creates a new core based on a descriptor but does not register it. |
protected CoreAdminHandler |
createMultiCoreHandler(String adminHandlerClass)
Creates a CoreAdminHandler for this MultiCore. |
static void |
fileCopy(File src,
File dest)
Copies a src file to a dest file: used to circumvent the platform discrepancies regarding renaming files. |
protected void |
finalize()
|
SolrCore |
getAdminCore()
Deprecated. |
String |
getAdminPath()
|
File |
getConfigFile()
|
Properties |
getContainerProperties()
|
SolrCore |
getCore(String name)
Gets a core by name and increase its refcount. |
Collection<String> |
getCoreNames()
|
Collection<String> |
getCoreNames(SolrCore core)
This method is currently experimental. |
Collection<SolrCore> |
getCores()
|
String |
getManagementPath()
|
CoreAdminHandler |
getMultiCoreHandler()
|
String |
getSolrHome()
|
boolean |
isPersistent()
|
void |
load(String dir,
File configFile)
Load a config file listing the available solr cores. |
void |
persist()
Persists the cores config file in cores.xml. |
void |
persistFile(File file)
Persists the cores config file in a user provided file. |
SolrCore |
register(SolrCore core,
boolean returnPrev)
Registers a SolrCore descriptor in the registry using the core's name. |
SolrCore |
register(String name,
SolrCore core,
boolean returnPrevNotClosed)
Registers a SolrCore descriptor in the registry using the specified name. |
void |
reload(String name)
Recreates a SolrCore. |
SolrCore |
remove(String name)
Removes and returns registered core w/o decrementing it's reference count |
void |
setAdminCore(SolrCore core)
Deprecated. |
void |
setAdminPath(String adminPath)
|
void |
setManagementPath(String path)
Sets the alternate path for multicore handling: This is used in case there is a registered unnamed core (aka name is "") to declare an alternate way of accessing named cores. |
void |
setPersistent(boolean persistent)
|
void |
shutdown()
Stops all cores. |
void |
swap(String n0,
String n1)
Swaps two SolrCore descriptors. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.slf4j.Logger log
protected final Map<String,SolrCore> cores
protected boolean persistent
protected String adminPath
protected String managementPath
protected CoreAdminHandler coreAdminHandler
protected File configFile
protected String libDir
protected ClassLoader libLoader
protected SolrResourceLoader loader
protected WeakReference<SolrCore> adminCore
protected Properties containerProperties
protected Map<String,IndexSchema> indexSchemaCache
protected String adminHandler
protected boolean shareSchema
protected String solrHome
Constructor Detail |
---|
public CoreContainer()
public CoreContainer(String dir, File configFile) throws ParserConfigurationException, IOException, SAXException
dir
- configFile
-
ParserConfigurationException
IOException
SAXException
public CoreContainer(SolrResourceLoader loader)
loader
- the CoreContainer resource loaderpublic CoreContainer(String solrHome)
Method Detail |
---|
public Properties getContainerProperties()
public void load(String dir, File configFile) throws ParserConfigurationException, IOException, SAXException
dir
- the home directory of all resources.configFile
- the configuration file
ParserConfigurationException
IOException
SAXException
public void shutdown()
protected void finalize() throws Throwable
finalize
in class Object
Throwable
public SolrCore register(String name, SolrCore core, boolean returnPrevNotClosed)
public SolrCore register(SolrCore core, boolean returnPrev)
public SolrCore create(CoreDescriptor dcore) throws ParserConfigurationException, IOException, SAXException
dcore
- a core descriptor
ParserConfigurationException
IOException
SAXException
public Collection<SolrCore> getCores()
public Collection<String> getCoreNames()
public Collection<String> getCoreNames(SolrCore core)
public void reload(String name) throws ParserConfigurationException, IOException, SAXException
name
- the name of the SolrCore to reload
ParserConfigurationException
IOException
SAXException
public void swap(String n0, String n1)
n0
- n1
- public SolrCore remove(String name)
public SolrCore getCore(String name)
name
- the core name
SolrCore.open()
,
SolrCore.close()
@Deprecated public void setAdminCore(SolrCore core)
@Deprecated public SolrCore getAdminCore()
SolrCore.close()
protected CoreAdminHandler createMultiCoreHandler(String adminHandlerClass)
public CoreAdminHandler getMultiCoreHandler()
public boolean isPersistent()
public void setPersistent(boolean persistent)
public String getAdminPath()
public void setAdminPath(String adminPath)
public String getManagementPath()
public void setManagementPath(String path)
path
- public File getConfigFile()
public void persist()
public void persistFile(File file)
public static void fileCopy(File src, File dest) throws IOException
IOException
public String getSolrHome()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |