Package org.apache.solr.core
Class CorePropertiesLocator
- java.lang.Object
-
- org.apache.solr.core.CorePropertiesLocator
-
- All Implemented Interfaces:
CoresLocator
public class CorePropertiesLocator extends Object implements CoresLocator
Persists CoreDescriptors as properties files
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROPERTIES_FILENAME
-
Constructor Summary
Constructors Constructor Description CorePropertiesLocator(Path coreDiscoveryRoot)
CorePropertiesLocator(NodeConfig nodeConfig)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CoreDescriptor
buildCoreDescriptor(Path propertiesFile, CoreContainer cc)
protected Properties
buildCoreProperties(CoreDescriptor cd)
void
create(CoreContainer cc, CoreDescriptor... coreDescriptors)
Make new cores available for discoveryprotected static String
createName(Properties p, Path instanceDir)
void
delete(CoreContainer cc, CoreDescriptor... coreDescriptors)
Ensure that the core definitions from the passed in CoreDescriptors are not available for discoveryList<CoreDescriptor>
discover(CoreContainer cc)
Load all the CoreDescriptors from persistence storevoid
persist(CoreContainer cc, CoreDescriptor... coreDescriptors)
Ensure that the core definitions from the passed in CoreDescriptors will persist across container restarts.CoreDescriptor
reload(CoreDescriptor cd, CoreContainer cc)
Reload a core descriptor.void
rename(CoreContainer cc, CoreDescriptor oldCD, CoreDescriptor newCD)
Persist the new name of a renamed corevoid
swap(CoreContainer cc, CoreDescriptor cd1, CoreDescriptor cd2)
Swap two core definitions
-
-
-
Field Detail
-
PROPERTIES_FILENAME
public static final String PROPERTIES_FILENAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CorePropertiesLocator
public CorePropertiesLocator(NodeConfig nodeConfig)
-
CorePropertiesLocator
public CorePropertiesLocator(Path coreDiscoveryRoot)
-
-
Method Detail
-
create
public void create(CoreContainer cc, CoreDescriptor... coreDescriptors)
Description copied from interface:CoresLocator
Make new cores available for discovery- Specified by:
create
in interfaceCoresLocator
- Parameters:
cc
- the CoreContainercoreDescriptors
- CoreDescriptors to persist
-
persist
public void persist(CoreContainer cc, CoreDescriptor... coreDescriptors)
Description copied from interface:CoresLocator
Ensure that the core definitions from the passed in CoreDescriptors will persist across container restarts.- Specified by:
persist
in interfaceCoresLocator
- Parameters:
cc
- the CoreContainercoreDescriptors
- CoreDescriptors to persist
-
delete
public void delete(CoreContainer cc, CoreDescriptor... coreDescriptors)
Description copied from interface:CoresLocator
Ensure that the core definitions from the passed in CoreDescriptors are not available for discovery- Specified by:
delete
in interfaceCoresLocator
- Parameters:
cc
- the CoreContainercoreDescriptors
- CoreDescriptors of the cores to remove
-
rename
public void rename(CoreContainer cc, CoreDescriptor oldCD, CoreDescriptor newCD)
Description copied from interface:CoresLocator
Persist the new name of a renamed core- Specified by:
rename
in interfaceCoresLocator
- Parameters:
cc
- the CoreContaineroldCD
- the CoreDescriptor of the core before renamingnewCD
- the CoreDescriptor of the core after renaming
-
swap
public void swap(CoreContainer cc, CoreDescriptor cd1, CoreDescriptor cd2)
Description copied from interface:CoresLocator
Swap two core definitions- Specified by:
swap
in interfaceCoresLocator
- Parameters:
cc
- the CoreContainercd1
- the core descriptor of the first core, after swappingcd2
- the core descriptor of the second core, after swapping
-
discover
public List<CoreDescriptor> discover(CoreContainer cc)
Description copied from interface:CoresLocator
Load all the CoreDescriptors from persistence store- Specified by:
discover
in interfaceCoresLocator
- Parameters:
cc
- the CoreContainer- Returns:
- a list of all CoreDescriptors found
-
reload
public CoreDescriptor reload(CoreDescriptor cd, CoreContainer cc)
Description copied from interface:CoresLocator
Reload a core descriptor.- Specified by:
reload
in interfaceCoresLocator
- Parameters:
cd
- the old core descriptorcc
- the CoreContainer- Returns:
- a new core descriptor
-
buildCoreDescriptor
protected CoreDescriptor buildCoreDescriptor(Path propertiesFile, CoreContainer cc)
-
createName
protected static String createName(Properties p, Path instanceDir)
-
buildCoreProperties
protected Properties buildCoreProperties(CoreDescriptor cd)
-
-