public class TransientSolrCoreCacheDefault extends TransientSolrCoreCache
Modifier and Type | Field and Description |
---|---|
protected CoreContainer |
coreContainer |
protected com.github.benmanes.caffeine.cache.Cache<String,SolrCore> |
transientCores
"Lazily loaded" cores cache with limited size.
|
protected Map<String,CoreDescriptor> |
transientDescriptors
Unlimited map of all the descriptors for all the registered transient cores, including the
cores in the
transientCores as well as all the others. |
Constructor and Description |
---|
TransientSolrCoreCacheDefault(CoreContainer container) |
Modifier and Type | Method and Description |
---|---|
SolrCore |
addCore(String name,
SolrCore core)
Adds the newly-opened core to the list of open cores.
|
void |
addTransientDescriptor(String rawName,
CoreDescriptor cd)
Adds a new
CoreDescriptor . |
boolean |
containsCore(String name)
Returns whether the cache contains the named core.
|
Set<String> |
getAllCoreNames()
Returns the names of all possible cores, whether they are currently loaded or not.
|
CoreContainer |
getContainer()
Gets the core container that encloses this cache.
|
SolrCore |
getCore(String name)
Gets the core associated with the name.
|
Set<String> |
getLoadedCoreNames()
Returns the names of all currently loaded cores.
|
int |
getStatus(String coreName)
Gets a custom status for the given core name.
|
CoreDescriptor |
getTransientDescriptor(String name)
Gets the
CoreDescriptor for a transient core (loaded or unloaded). |
Collection<CoreDescriptor> |
getTransientDescriptors()
Gets the
CoreDescriptor for all transient cores (loaded and unloaded). |
Collection<SolrCore> |
prepareForShutdown()
This method will be called when the container is to be shut down.
|
SolrCore |
removeCore(String name)
Removes a core from the internal structures, presumably it being closed.
|
CoreDescriptor |
removeTransientDescriptor(String name)
Removes a
CoreDescriptor from the list of transient cores descriptors. |
void |
setStatus(String coreName,
int status)
Sets a custom status for the given core name.
|
close
protected final CoreContainer coreContainer
protected final com.github.benmanes.caffeine.cache.Cache<String,SolrCore> transientCores
protected final Map<String,CoreDescriptor> transientDescriptors
transientCores
as well as all the others.public TransientSolrCoreCacheDefault(CoreContainer container)
container
- The enclosing CoreContainer.public Collection<SolrCore> prepareForShutdown()
TransientSolrCoreCache
prepareForShutdown
in class TransientSolrCoreCache
public CoreContainer getContainer()
TransientSolrCoreCache
getContainer
in class TransientSolrCoreCache
public SolrCore addCore(String name, SolrCore core)
TransientSolrCoreCache
addCore
in class TransientSolrCoreCache
public Set<String> getAllCoreNames()
TransientSolrCoreCache
getAllCoreNames
in class TransientSolrCoreCache
public Set<String> getLoadedCoreNames()
TransientSolrCoreCache
getLoadedCoreNames
in class TransientSolrCoreCache
public SolrCore removeCore(String name)
TransientSolrCoreCache
removeCore
in class TransientSolrCoreCache
public SolrCore getCore(String name)
TransientSolrCoreCache
getCore
in class TransientSolrCoreCache
public boolean containsCore(String name)
TransientSolrCoreCache
containsCore
in class TransientSolrCoreCache
public void addTransientDescriptor(String rawName, CoreDescriptor cd)
TransientSolrCoreCache
CoreDescriptor
.
This method will only be called during core discovery at startup.addTransientDescriptor
in class TransientSolrCoreCache
public CoreDescriptor getTransientDescriptor(String name)
TransientSolrCoreCache
CoreDescriptor
for a transient core (loaded or unloaded).
This method is used when opening cores and the like. If you want to change a core's descriptor,
override this method and return the current core descriptor.getTransientDescriptor
in class TransientSolrCoreCache
public Collection<CoreDescriptor> getTransientDescriptors()
TransientSolrCoreCache
CoreDescriptor
for all transient cores (loaded and unloaded).getTransientDescriptors
in class TransientSolrCoreCache
public CoreDescriptor removeTransientDescriptor(String name)
TransientSolrCoreCache
CoreDescriptor
from the list of transient cores descriptors.removeTransientDescriptor
in class TransientSolrCoreCache
public int getStatus(String coreName)
TransientSolrCoreCache
getStatus
in class TransientSolrCoreCache
public void setStatus(String coreName, int status)
TransientSolrCoreCache
setStatus
in class TransientSolrCoreCache
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.