Class SolrCores

    • Field Detail

      • modifyLock

        protected final Object modifyLock
    • Method Detail

      • addCoreDescriptor

        public void addCoreDescriptor​(CoreDescriptor p)
      • removeCoreDescriptor

        public void removeCoreDescriptor​(CoreDescriptor p)
      • close

        protected void close()
      • getCores

        public List<SolrCore> getCores()
        A list of "permanent" cores, i.e. cores that may not be swapped out and are currently loaded.

        A core may be non-transient but still lazily loaded. If it is "permanent" and lazy-load _and_ not yet loaded it will _not_ be returned by this call.

        This list is a new copy, it can be modified by the caller (e.g. it can be sorted).

        Note: This is one of the places where SolrCloud is incompatible with Transient Cores. This call is used in cancelRecoveries, transient cores don't participate.

      • getLoadedCoreNames

        public List<String> getLoadedCoreNames()
        Gets the cores that are currently loaded, i.e. cores that have 1: loadOnStartup=true and are either not-transient or, if transient, have been loaded and have not been aged out 2: loadOnStartup=false and have been loaded but either non-transient or have not been aged out.

        Put another way, this will not return any names of cores that are lazily loaded but have not been called for yet or are transient and either not loaded or have been swapped out.

        An unsorted list. This list is a new copy, it can be modified by the caller (e.g. it can be sorted).
      • getAllCoreNames

        public List<String> getAllCoreNames()
        Gets a collection of all cores names, loaded and unloaded. For efficiency, prefer to check getCoreDescriptor(String) != null instead of getAllCoreNames().contains(String)
        An unsorted list. This list is a new copy, it can be modified by the caller (e.g. it can be sorted).
      • getNumLoadedPermanentCores

        public int getNumLoadedPermanentCores()
        Gets the number of currently loaded permanent (non transient) cores. Faster equivalent for getCores().size().
      • getNumLoadedTransientCores

        public int getNumLoadedTransientCores()
        Gets the number of currently loaded transient cores.
      • getNumUnloadedCores

        public int getNumUnloadedCores()
        Gets the number of unloaded cores, including permanent and transient cores.
      • getNumAllCores

        public int getNumAllCores()
        Gets the total number of cores, including permanent and transient cores, loaded and unloaded cores. Faster equivalent for getAllCoreNames().size().
      • getCoreFromAnyList

        public SolrCore getCoreFromAnyList​(String name,
                                           boolean incRefCount)
      • getCoreFromAnyList

        public SolrCore getCoreFromAnyList​(String name,
                                           boolean incRefCount,
                                           UUID coreId)
      • getLoadedCoreWithoutIncrement

        protected SolrCore getLoadedCoreWithoutIncrement​(String name)
        (internal) Return a core that is already loaded, if it is. NOT incremented!
      • isLoadedNotPendingClose

        public boolean isLoadedNotPendingClose​(String name)
      • isLoaded

        public boolean isLoaded​(String name)
      • hasPendingCoreOps

        protected boolean hasPendingCoreOps​(String name)
        The core is currently loading, unloading, or reloading.
      • waitAddPendingCoreOps

        public SolrCore waitAddPendingCoreOps​(String name)
      • removeFromPendingOps

        public void removeFromPendingOps​(String name)
      • getModifyLock

        public Object getModifyLock()
      • getCoreToClose

        public SolrCore getCoreToClose()
      • getCoreDescriptor

        public CoreDescriptor getCoreDescriptor​(String coreName)
        Return the CoreDescriptor corresponding to a given core name. Blocks if the SolrCore is still loading until it is ready.
        coreName - the name of the core
        the CoreDescriptor
      • getCoreDescriptors

        public List<CoreDescriptor> getCoreDescriptors()
        Get the CoreDescriptors for every SolrCore managed here (permanent and transient, loaded and unloaded).
        An unordered list copy. This list can be modified by the caller (e.g. sorted).
      • markCoreAsLoading

        public void markCoreAsLoading​(CoreDescriptor cd)
      • markCoreAsNotLoading

        public void markCoreAsNotLoading​(CoreDescriptor cd)
      • waitForLoadingCoresToFinish

        public void waitForLoadingCoresToFinish​(long timeoutMs)
      • waitForLoadingCoreToFinish

        public void waitForLoadingCoreToFinish​(String core,
                                               long timeoutMs)
      • isCoreLoading

        public boolean isCoreLoading​(String name)
      • queueCoreToClose

        public void queueCoreToClose​(SolrCore coreToClose)