public class CoreContainer extends Object
Modifier and Type | Field and Description |
---|---|
protected ConfigSolr |
cfg |
protected CollectionsHandler |
collectionsHandler |
protected Properties |
containerProperties |
protected CoreAdminHandler |
coreAdminHandler |
protected Map<String,Exception> |
coreInitFailures |
protected CoresLocator |
coresLocator |
protected Map<String,IndexSchema> |
indexSchemaCache |
protected SolrResourceLoader |
loader |
protected static org.slf4j.Logger |
log |
protected LogWatcher |
logging |
protected boolean |
shareSchema |
protected String |
solrHome |
protected ZkContainer |
zkSys |
Constructor and Description |
---|
CoreContainer()
Create a new CoreContainer using system properties to detect the solr home
directory.
|
CoreContainer(SolrResourceLoader loader)
Create a new CoreContainer using the given SolrResourceLoader.
|
CoreContainer(SolrResourceLoader loader,
ConfigSolr config)
Create a new CoreContainer using the given SolrResourceLoader,
configuration and CoresLocator.
|
CoreContainer(SolrResourceLoader loader,
ConfigSolr config,
CoresLocator locator) |
CoreContainer(String solrHome)
Create a new CoreContainer using the given solr home directory.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelCoreRecoveries() |
SolrCore |
create(CoreDescriptor dcore)
Creates a new core based on a descriptor but does not register it.
|
static CoreContainer |
createAndLoad(String solrHome,
File configFile)
Create a new CoreContainer and load its cores
|
protected CoreAdminHandler |
createMultiCoreHandler(String adminHandlerClass)
Creates a CoreAdminHandler for this MultiCore.
|
protected void |
finalize() |
String |
getAdminPath() |
Collection<String> |
getAllCoreNames()
get a list of all the cores that are currently loaded
|
CollectionsHandler |
getCollectionsHandler() |
Properties |
getContainerProperties() |
SolrCore |
getCore(String name)
Gets a core by name and increase its refcount.
|
CoreDescriptor |
getCoreDescriptor(String coreName) |
List<CoreDescriptor> |
getCoreDescriptors()
Get the CoreDescriptors for all cores managed by this container
|
Map<String,Exception> |
getCoreInitFailures()
Returns an immutable Map of Exceptions that occured when initializing
SolrCores (either at startup, or do to runtime requests to create cores)
keyed off of the name (String) of the SolrCore that had the Exception
during initialization.
|
Collection<String> |
getCoreNames() |
Collection<String> |
getCoreNames(SolrCore core)
This method is currently experimental.
|
Collection<SolrCore> |
getCores() |
CoresLocator |
getCoresLocator() |
String |
getDefaultCoreName()
the default core name, or null if there is no default core name
|
InfoHandler |
getInfoHandler() |
LogWatcher |
getLogging() |
String |
getManagementPath()
Gets 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.
|
CoreAdminHandler |
getMultiCoreHandler() |
ShardHandlerFactory |
getShardHandlerFactory()
The default ShardHandlerFactory used to communicate with other solr instances
|
String |
getSolrHome() |
CoreDescriptor |
getUnloadedCoreDescriptor(String cname)
Gets a solr core descriptor for a core that is not loaded.
|
ExecutorService |
getUpdateExecutor() |
ZkController |
getZkController() |
boolean |
isLoaded(String name)
Determines whether the core is already loaded or not but does NOT load the core
|
boolean |
isLoadedNotPendingClose(String name) |
boolean |
isPersistent()
Deprecated.
|
boolean |
isShareSchema() |
boolean |
isShutDown() |
boolean |
isZooKeeperAware() |
void |
load()
Load the cores defined for this CoreContainer
|
void |
preRegisterInZk(CoreDescriptor p) |
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 returnPrev) |
protected SolrCore |
registerCore(boolean isTransientCore,
String name,
SolrCore core,
boolean returnPrevNotClosed) |
void |
reload(String name)
Recreates a SolrCore.
|
SolrCore |
remove(String name)
Removes and returns registered core w/o decrementing it's reference count
|
void |
rename(String name,
String toName) |
void |
shutdown()
Stops all cores.
|
void |
swap(String n0,
String n1)
Swaps two SolrCore descriptors.
|
protected static final org.slf4j.Logger log
protected CoreAdminHandler coreAdminHandler
protected CollectionsHandler collectionsHandler
protected Properties containerProperties
protected Map<String,IndexSchema> indexSchemaCache
protected boolean shareSchema
protected ZkContainer zkSys
protected LogWatcher logging
protected final ConfigSolr cfg
protected final SolrResourceLoader loader
protected final String solrHome
protected final CoresLocator coresLocator
public CoreContainer()
load()
public CoreContainer(SolrResourceLoader loader)
loader
- the SolrResourceLoaderload()
public CoreContainer(String solrHome)
solrHome
- a String containing the path to the solr home directoryload()
public CoreContainer(SolrResourceLoader loader, ConfigSolr config)
loader
- the SolrResourceLoaderconfig
- a ConfigSolr representation of this container's configurationload()
public CoreContainer(SolrResourceLoader loader, ConfigSolr config, CoresLocator locator)
public static CoreContainer createAndLoad(String solrHome, File configFile)
solrHome
- the solr home directoryconfigFile
- the file containing this container's configurationpublic Properties getContainerProperties()
public void load()
public boolean isShutDown()
public void shutdown()
public void cancelCoreRecoveries()
protected void finalize() throws Throwable
public CoresLocator getCoresLocator()
protected SolrCore registerCore(boolean isTransientCore, String name, SolrCore core, boolean returnPrevNotClosed)
public SolrCore register(SolrCore core, boolean returnPrev)
public SolrCore create(CoreDescriptor dcore)
dcore
- a core descriptorpublic Collection<SolrCore> getCores()
public Collection<String> getCoreNames()
public Collection<String> getCoreNames(SolrCore core)
public Collection<String> getAllCoreNames()
public Map<String,Exception> getCoreInitFailures()
While the Map returned by this method is immutable and will not change once returned to the client, the source data used to generate this Map can be changed as various SolrCore operations are performed:
public void reload(String name)
name
- the name of the SolrCore to reloadpublic SolrCore remove(String name)
public List<CoreDescriptor> getCoreDescriptors()
public CoreDescriptor getCoreDescriptor(String coreName)
public SolrCore getCore(String name)
name
- the core nameSolrException
- if a SolrCore with this name failed to be initializedSolrCore.close()
protected CoreAdminHandler createMultiCoreHandler(String adminHandlerClass)
public CoreAdminHandler getMultiCoreHandler()
public CollectionsHandler getCollectionsHandler()
public InfoHandler getInfoHandler()
public String getDefaultCoreName()
@Deprecated public boolean isPersistent()
public String getAdminPath()
public String getManagementPath()
public LogWatcher getLogging()
public boolean isLoaded(String name)
public boolean isLoadedNotPendingClose(String name)
public CoreDescriptor getUnloadedCoreDescriptor(String cname)
cname
- - name of the unloaded core descriptor to load. NOTE:public void preRegisterInZk(CoreDescriptor p)
public String getSolrHome()
public boolean isZooKeeperAware()
public ZkController getZkController()
public boolean isShareSchema()
public ShardHandlerFactory getShardHandlerFactory()
public ExecutorService getUpdateExecutor()
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.