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 Details

  • Constructor Details

    • CorePropertiesLocator

      public CorePropertiesLocator(NodeConfig nodeConfig)
    • CorePropertiesLocator

      public CorePropertiesLocator(Path coreDiscoveryRoot)
  • Method Details

    • create

      public void create(CoreContainer cc, CoreDescriptor... coreDescriptors)
      Description copied from interface: CoresLocator
      Make new cores available for discovery
      Specified by:
      create in interface CoresLocator
      Parameters:
      cc - the CoreContainer
      coreDescriptors - 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 interface CoresLocator
      Parameters:
      cc - the CoreContainer
      coreDescriptors - 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 interface CoresLocator
      Parameters:
      cc - the CoreContainer
      coreDescriptors - 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 interface CoresLocator
      Parameters:
      cc - the CoreContainer
      oldCD - the CoreDescriptor of the core before renaming
      newCD - 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 interface CoresLocator
      Parameters:
      cc - the CoreContainer
      cd1 - the core descriptor of the first core, after swapping
      cd2 - 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 interface CoresLocator
      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 interface CoresLocator
      Parameters:
      cd - the old core descriptor
      cc - 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)