You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by da...@apache.org on 2020/09/01 07:30:24 UTC

[lucene-solr] 06/08: revert changes

This is an automated email from the ASF dual-hosted git repository.

datcm pushed a commit to branch datcm/bloomberg-abdicate-leadership
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit c4823204796ed5a12a0db8a7e84a7dd00e66915a
Author: Cao Manh Dat <da...@apache.org>
AuthorDate: Fri Aug 28 10:37:26 2020 +0700

    revert changes
---
 .../src/java/org/apache/solr/core/SolrCores.java   | 32 +++++++++++-----------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/core/SolrCores.java b/solr/core/src/java/org/apache/solr/core/SolrCores.java
index 9a453c9..205b70f 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrCores.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrCores.java
@@ -48,7 +48,7 @@ class SolrCores {
   private final Map<String, CoreDescriptor> residentDesciptors = new LinkedHashMap<>();
 
   private final CoreContainer container;
-
+  
   private Set<String> currentlyLoadingCores = Collections.newSetFromMap(new ConcurrentHashMap<String,Boolean>());
 
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@@ -64,11 +64,11 @@ class SolrCores {
   private TransientSolrCoreCacheFactory transientCoreCache;
 
   private TransientSolrCoreCache transientSolrCoreCache = null;
-
+  
   SolrCores(CoreContainer container) {
     this.container = container;
   }
-
+  
   protected void addCoreDescriptor(CoreDescriptor p) {
     synchronized (modifyLock) {
       if (p.isTransient()) {
@@ -104,7 +104,7 @@ class SolrCores {
     waitForLoadingCoresToFinish(30*1000);
     Collection<SolrCore> coreList = new ArrayList<>();
 
-
+    
     TransientSolrCoreCache transientSolrCoreCache = getTransientCacheHandler();
     // Release observer
     if (transientSolrCoreCache != null) {
@@ -127,7 +127,7 @@ class SolrCores {
         coreList.addAll(pendingCloses);
         pendingCloses.clear();
       }
-
+      
       ExecutorService coreCloseExecutor = ExecutorUtil.newMDCAwareFixedThreadPool(Integer.MAX_VALUE,
           new SolrNamedThreadFactory("coreCloseExecutor"));
       try {
@@ -153,7 +153,7 @@ class SolrCores {
 
     } while (coreList.size() > 0);
   }
-
+  
   // Returns the old core if there was a core of the same name.
   //WARNING! This should be the _only_ place you put anything into the list of transient cores!
   protected SolrCore putCore(CoreDescriptor cd, SolrCore core) {
@@ -174,11 +174,11 @@ class SolrCores {
   /**
    *
    * @return 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.
-   *
-   * Note: This is one of the places where SolrCloud is incompatible with Transient Cores. This call is used in
+   * 
+   * 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.
    */
 
@@ -194,10 +194,10 @@ class SolrCores {
    * 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.
-   *
+   * 
    * @return List of currently loaded cores.
    */
   Set<String> getLoadedCoreNames() {
@@ -212,7 +212,7 @@ class SolrCores {
     return set;
   }
   /**
-   * Gets a list of all cores, loaded and unloaded
+   * Gets a list of all cores, loaded and unloaded 
    *
    * @return all cores names, whether loaded or unloaded, transient or permanent.
    */
@@ -252,16 +252,16 @@ class SolrCores {
           throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "No such core: " + n1);
         }
       }
-      // When we swap the cores, we also need to swap the associated core descriptors. Note, this changes the
+      // When we swap the cores, we also need to swap the associated core descriptors. Note, this changes the 
       // name of the coreDescriptor by virtue of the c-tor
-      CoreDescriptor cd1 = c1.getCoreDescriptor();
+      CoreDescriptor cd1 = c1.getCoreDescriptor(); 
       addCoreDescriptor(new CoreDescriptor(n1, c0.getCoreDescriptor()));
       addCoreDescriptor(new CoreDescriptor(n0, cd1));
       cores.put(n0, c1);
       cores.put(n1, c0);
       c0.setName(n1);
       c1.setName(n0);
-
+      
       container.getMetricManager().swapRegistries(
           c0.getCoreMetricManager().getRegistryName(),
           c1.getCoreMetricManager().getRegistryName());
@@ -483,7 +483,7 @@ class SolrCores {
       }
     }
   }
-
+  
   // returns when core is finished loading, throws exception if no such core loading or loaded
   public void waitForLoadingCoreToFinish(String core, long timeoutMs) {
     long time = System.nanoTime();