public class CoreContainer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CoreContainer.CoreLoadFailure |
Modifier and Type | Field and Description |
---|---|
static String |
AUTHENTICATION_PLUGIN_PROP |
protected AuthenticationPlugin |
authenticationPlugin |
protected AuthorizationPlugin |
authorizationPlugin |
protected NodeConfig |
cfg |
static String |
COLLECTIONS_HANDLER_PATH |
protected CollectionsHandler |
collectionsHandler |
protected Properties |
containerProperties |
protected CoreAdminHandler |
coreAdminHandler |
protected Map<String,CoreContainer.CoreLoadFailure> |
coreInitFailures |
static String |
CORES_HANDLER_PATH |
protected CoresLocator |
coresLocator |
static String |
INFO_HANDLER_PATH |
protected SolrResourceLoader |
loader |
protected static org.slf4j.Logger |
log |
protected LogWatcher |
logging |
protected ShardHandlerFactory |
shardHandlerFactory |
protected String |
solrHome |
protected ZkContainer |
zkSys |
Modifier | Constructor and Description |
---|---|
|
CoreContainer()
Create a new CoreContainer using system properties to detect the solr home
directory.
|
|
CoreContainer(NodeConfig config)
Create a new CoreContainer using the given SolrResourceLoader,
configuration and CoresLocator.
|
|
CoreContainer(NodeConfig config,
Properties properties) |
|
CoreContainer(NodeConfig config,
Properties properties,
CoresLocator locator) |
protected |
CoreContainer(Object testConstructor)
This method allows subclasses to construct a CoreContainer
without any default init behavior.
|
|
CoreContainer(SolrResourceLoader loader)
Create a new CoreContainer using the given SolrResourceLoader.
|
|
CoreContainer(String solrHome)
Create a new CoreContainer using the given solr home directory.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelCoreRecoveries() |
SolrCore |
create(CoreDescriptor cd)
Creates a new core based on a CoreDescriptor, publishing the core state to the cluster
|
SolrCore |
create(CoreDescriptor dcore,
boolean publishState)
Creates a new core based on a CoreDescriptor.
|
static CoreContainer |
createAndLoad(String solrHome,
File configFile)
Create a new CoreContainer and load its cores
|
protected <T> T |
createHandler(String handlerClass,
Class<T> clazz) |
protected void |
finalize() |
Collection<String> |
getAllCoreNames()
get a list of all the cores that are currently loaded
|
AuthenticationPlugin |
getAuthenticationPlugin() |
AuthorizationPlugin |
getAuthorizationPlugin() |
CollectionsHandler |
getCollectionsHandler() |
NodeConfig |
getConfig() |
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,CoreContainer.CoreLoadFailure> |
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.
|
String |
getCoreRootDirectory() |
Collection<SolrCore> |
getCores() |
CoresLocator |
getCoresLocator() |
ExecutorService |
getCoreZkRegisterExecutorService() |
String |
getHostName() |
InfoHandler |
getInfoHandler() |
JarRepository |
getJarRepository() |
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() |
SolrRequestHandler |
getRequestHandler(String path) |
PluginBag<SolrRequestHandler> |
getRequestHandlers() |
SolrResourceLoader |
getResourceLoader() |
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.
|
UpdateShardHandler |
getUpdateShardHandler() |
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 |
isShutDown() |
boolean |
isZooKeeperAware() |
void |
load()
Load the cores defined for this CoreContainer
|
protected SolrCore |
registerCore(String name,
SolrCore core,
boolean registerInZk) |
void |
reload(String name)
Recreates a SolrCore.
|
void |
rename(String name,
String toName) |
void |
shutdown()
Stops all cores.
|
void |
swap(String n0,
String n1)
Swaps two SolrCore descriptors.
|
void |
unload(String name)
Unload a core from this container, leaving all files on disk
|
void |
unload(String name,
boolean deleteIndexDir,
boolean deleteDataDir,
boolean deleteInstanceDir)
Unload a core from this container, optionally removing the core's data and configuration
|
protected static final org.slf4j.Logger log
protected AuthorizationPlugin authorizationPlugin
protected AuthenticationPlugin authenticationPlugin
protected final Map<String,CoreContainer.CoreLoadFailure> coreInitFailures
protected CoreAdminHandler coreAdminHandler
protected CollectionsHandler collectionsHandler
protected Properties containerProperties
protected ZkContainer zkSys
protected ShardHandlerFactory shardHandlerFactory
protected LogWatcher logging
protected final NodeConfig cfg
protected final SolrResourceLoader loader
protected final String solrHome
protected final CoresLocator coresLocator
public static final String CORES_HANDLER_PATH
public static final String COLLECTIONS_HANDLER_PATH
public static final String INFO_HANDLER_PATH
public static final String AUTHENTICATION_PLUGIN_PROP
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(NodeConfig config)
config
- a ConfigSolr representation of this container's configurationload()
public CoreContainer(NodeConfig config, Properties properties)
public CoreContainer(NodeConfig config, Properties properties, CoresLocator locator)
protected CoreContainer(Object testConstructor)
testConstructor
- pass (Object)null.public ExecutorService getCoreZkRegisterExecutorService()
public SolrRequestHandler getRequestHandler(String path)
public PluginBag<SolrRequestHandler> getRequestHandlers()
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()
public SolrCore create(CoreDescriptor cd)
cd
- the CoreDescriptorpublic SolrCore create(CoreDescriptor dcore, boolean publishState)
dcore
- a core descriptorpublishState
- publish core state to the cluster if truepublic Collection<SolrCore> getCores()
public Collection<String> getCoreNames()
public Collection<String> getCoreNames(SolrCore core)
public Collection<String> getAllCoreNames()
public Map<String,CoreContainer.CoreLoadFailure> 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 void unload(String name)
name
- the name of the core to unloadpublic void unload(String name, boolean deleteIndexDir, boolean deleteDataDir, boolean deleteInstanceDir)
name
- the name of the core to unloaddeleteIndexDir
- if true, delete the core's index on closedeleteDataDir
- if true, delete the core's data directory on closedeleteInstanceDir
- if true, delete the core's instance directory on closepublic List<CoreDescriptor> getCoreDescriptors()
public CoreDescriptor getCoreDescriptor(String coreName)
public String getCoreRootDirectory()
public SolrCore getCore(String name)
name
- the core nameSolrException
- if a SolrCore with this name failed to be initializedSolrCore.close()
public JarRepository getJarRepository()
public CoreAdminHandler getMultiCoreHandler()
public CollectionsHandler getCollectionsHandler()
public InfoHandler getInfoHandler()
public String getHostName()
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 String getSolrHome()
public boolean isZooKeeperAware()
public ZkController getZkController()
public NodeConfig getConfig()
public ShardHandlerFactory getShardHandlerFactory()
public UpdateShardHandler getUpdateShardHandler()
public SolrResourceLoader getResourceLoader()
public AuthorizationPlugin getAuthorizationPlugin()
public AuthenticationPlugin getAuthenticationPlugin()
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.