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 StringPROPERTIES_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 CoreDescriptorbuildCoreDescriptor(Path propertiesFile, CoreContainer cc)protected PropertiesbuildCoreProperties(CoreDescriptor cd)voidcreate(CoreContainer cc, CoreDescriptor... coreDescriptors)Make new cores available for discoveryprotected static StringcreateName(Properties p, Path instanceDir)voiddelete(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 storevoidpersist(CoreContainer cc, CoreDescriptor... coreDescriptors)Ensure that the core definitions from the passed in CoreDescriptors will persist across container restarts.CoreDescriptorreload(CoreDescriptor cd, CoreContainer cc)Reload a core descriptor.voidrename(CoreContainer cc, CoreDescriptor oldCD, CoreDescriptor newCD)Persist the new name of a renamed corevoidswap(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:CoresLocatorMake new cores available for discovery- Specified by:
createin interfaceCoresLocator- Parameters:
cc- the CoreContainercoreDescriptors- CoreDescriptors to persist
-
persist
public void persist(CoreContainer cc, CoreDescriptor... coreDescriptors)
Description copied from interface:CoresLocatorEnsure that the core definitions from the passed in CoreDescriptors will persist across container restarts.- Specified by:
persistin interfaceCoresLocator- Parameters:
cc- the CoreContainercoreDescriptors- CoreDescriptors to persist
-
delete
public void delete(CoreContainer cc, CoreDescriptor... coreDescriptors)
Description copied from interface:CoresLocatorEnsure that the core definitions from the passed in CoreDescriptors are not available for discovery- Specified by:
deletein 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:CoresLocatorPersist the new name of a renamed core- Specified by:
renamein 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:CoresLocatorSwap two core definitions- Specified by:
swapin 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:CoresLocatorLoad all the CoreDescriptors from persistence store- Specified by:
discoverin interfaceCoresLocator- Parameters:
cc- the CoreContainer- Returns:
- a list of all CoreDescriptors found
-
reload
public CoreDescriptor reload(CoreDescriptor cd, CoreContainer cc)
Description copied from interface:CoresLocatorReload a core descriptor.- Specified by:
reloadin 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)
-
-