lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r1637296 - in /lucene/dev/trunk/solr: ./ core/src/java/org/apache/solr/cloud/ core/src/java/org/apache/solr/core/ core/src/java/org/apache/solr/handler/ core/src/java/org/apache/solr/handler/admin/ core/src/java/org/apache/solr/schema/
Date Fri, 07 Nov 2014 06:39:27 GMT
Author: shalin
Date: Fri Nov  7 06:39:26 2014
New Revision: 1637296

URL: http://svn.apache.org/r1637296
Log:
SOLR-6715: ZkSolrResourceLoader constructors accept a parameter called 'collection' but it
should be 'configName'

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/CloudUtil.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkController.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkSolrResourceLoader.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/EditFileRequestHandler.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/ManagedIndexSchema.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/ManagedIndexSchemaFactory.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1637296&r1=1637295&r2=1637296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Fri Nov  7 06:39:26 2014
@@ -369,6 +369,9 @@ Other Changes
   References to zkCredentialProvider in System properties or configurations should be
   changed to zkCredentialsProvider.  (Gregory Chanan)
 
+* SOLR-6715: ZkSolrResourceLoader constructors accept a parameter called 'collection'
+  but it should be 'configName'. (shalin)
+
 ==================  4.10.3 ==================
 
 Bug Fixes

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/CloudUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/CloudUtil.java?rev=1637296&r1=1637295&r2=1637296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/CloudUtil.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/CloudUtil.java Fri Nov  7 06:39:26
2014
@@ -88,7 +88,7 @@ public class CloudUtil {
 
   /**
    * Returns a displayable unified path to the given resource. For non-solrCloud that will
be the
-   * same as getConfigDir, but for Cloud it will be getCollectionZkPath ending in a /
+   * same as getConfigDir, but for Cloud it will be getConfigSetZkPath ending in a /
    * <p/>
    * <b>Note:</b> Do not use this to generate a valid file path, but for debug
printing etc
    * @param loader Resource loader instance
@@ -96,7 +96,7 @@ public class CloudUtil {
    */
   public static String unifiedResourcePath(SolrResourceLoader loader) {
     return (loader instanceof ZkSolrResourceLoader) ?
-            ((ZkSolrResourceLoader) loader).getCollectionZkPath() + "/" :
+            ((ZkSolrResourceLoader) loader).getConfigSetZkPath() + "/" :
             loader.getConfigDir();
   }
 }

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkController.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkController.java?rev=1637296&r1=1637295&r2=1637296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkController.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkController.java Fri Nov  7
06:39:26 2014
@@ -1200,7 +1200,7 @@ public final class ZkController {
     boolean removeWatch = true;
     // if there is no SolrCore which is a member of this collection, remove the watch
     for (SolrCore solrCore : cc.getCores()) {
-      if (((ZkSolrResourceLoader)solrCore.getResourceLoader()).getCollectionZkPath().equals(configLocation))
+      if (((ZkSolrResourceLoader)solrCore.getResourceLoader()).getConfigSetZkPath().equals(configLocation))
         configLocation = null; //if a core uses this config dir , then set it to null
 
 
@@ -2119,7 +2119,7 @@ public final class ZkController {
     final ZkSolrResourceLoader zkLoader = (ZkSolrResourceLoader)loader;
     final ZkController zkController = zkLoader.getZkController();
     final SolrZkClient zkClient = zkController.getZkClient();
-    final String resourceLocation = zkLoader.getCollectionZkPath() + "/" + resourceName;
+    final String resourceLocation = zkLoader.getConfigSetZkPath() + "/" + resourceName;
     String errMsg = "Failed to persist resource at {0} - version mismatch";
     try {
       try {

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkSolrResourceLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkSolrResourceLoader.java?rev=1637296&r1=1637295&r2=1637296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkSolrResourceLoader.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkSolrResourceLoader.java Fri
Nov  7 06:39:26 2014
@@ -38,16 +38,16 @@ import org.apache.zookeeper.data.Stat;
  */
 public class ZkSolrResourceLoader extends SolrResourceLoader {
 
-  private final String collectionZkPath;
+  private final String configSetZkPath;
   private ZkController zkController;
   private ZkIndexSchemaReader zkIndexSchemaReader;
 
-  public ZkSolrResourceLoader(String instanceDir, String collection,
+  public ZkSolrResourceLoader(String instanceDir, String configSet,
       ZkController zooKeeperController) {
     super(instanceDir);
     this.zkController = zooKeeperController;
-    collectionZkPath = ZkController.CONFIGS_ZKNODE + "/" + collection;
-    zkController.watchZKConfDir(collectionZkPath);
+    configSetZkPath = ZkController.CONFIGS_ZKNODE + "/" + configSet;
+    zkController.watchZKConfDir(configSetZkPath);
   }
 
   /**
@@ -58,12 +58,12 @@ public class ZkSolrResourceLoader extend
    * the "lib/" directory in the specified instance directory.
    * <p>
    */
-  public ZkSolrResourceLoader(String instanceDir, String collection, ClassLoader parent,
+  public ZkSolrResourceLoader(String instanceDir, String configSet, ClassLoader parent,
       Properties coreProperties, ZkController zooKeeperController) {
     super(instanceDir, parent, coreProperties);
     this.zkController = zooKeeperController;
-    collectionZkPath = ZkController.CONFIGS_ZKNODE + "/" + collection;
-    zkController.watchZKConfDir(collectionZkPath);
+    configSetZkPath = ZkController.CONFIGS_ZKNODE + "/" + configSet;
+    zkController.watchZKConfDir(configSetZkPath);
   }
 
   /**
@@ -78,7 +78,7 @@ public class ZkSolrResourceLoader extend
   @Override
   public InputStream openResource(String resource) throws IOException {
     InputStream is = null;
-    String file = collectionZkPath + "/" + resource;
+    String file = configSetZkPath + "/" + resource;
     try {
       if (zkController.pathExists(file)) {
         Stat stat = new Stat();
@@ -96,7 +96,7 @@ public class ZkSolrResourceLoader extend
     }
     if (is == null) {
       throw new IOException("Can't find resource '" + resource
-          + "' in classpath or '" + collectionZkPath + "', cwd="
+          + "' in classpath or '" + configSetZkPath + "', cwd="
           + System.getProperty("user.dir"));
     }
     return is;
@@ -131,7 +131,7 @@ public class ZkSolrResourceLoader extend
   public String[] listConfigDir() {
     List<String> list;
     try {
-      list = zkController.getZkClient().getChildren(collectionZkPath, null, true);
+      list = zkController.getZkClient().getChildren(configSetZkPath, null, true);
     } catch (InterruptedException e) {
       // Restore the interrupted status
       Thread.currentThread().interrupt();
@@ -146,8 +146,8 @@ public class ZkSolrResourceLoader extend
     return list.toArray(new String[0]);
   }
 
-  public String getCollectionZkPath() {
-    return collectionZkPath;
+  public String getConfigSetZkPath() {
+    return configSetZkPath;
   }
   
   public ZkController getZkController() {

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java?rev=1637296&r1=1637295&r2=1637296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java Fri Nov  7
06:39:26 2014
@@ -684,7 +684,7 @@ public class CoreContainer {
       // cancel recovery in cloud mode
       core.getSolrCoreState().cancelRecovery();
     }
-    String collectionZkPath =  core.getResourceLoader() instanceof ZkSolrResourceLoader ?
 ((ZkSolrResourceLoader)core.getResourceLoader()).getCollectionZkPath() : null;
+    String configSetZkPath =  core.getResourceLoader() instanceof ZkSolrResourceLoader ?
 ((ZkSolrResourceLoader)core.getResourceLoader()).getConfigSetZkPath() : null;
 
     core.unloadOnClose(deleteIndexDir, deleteDataDir, deleteInstanceDir);
     if (close)
@@ -692,7 +692,7 @@ public class CoreContainer {
 
     if (zkSys.getZkController() != null) {
       try {
-        zkSys.getZkController().unregister(name, cd, collectionZkPath);
+        zkSys.getZkController().unregister(name, cd, configSetZkPath);
       } catch (InterruptedException e) {
         Thread.currentThread().interrupt();
         throw new SolrException(ErrorCode.SERVER_ERROR, "Interrupted while unregistering
core [" + name + "] from cloud state");

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java?rev=1637296&r1=1637295&r2=1637296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java Fri
Nov  7 06:39:26 2014
@@ -100,7 +100,7 @@ public class SolrConfigHandler extends R
         public void run() {
           try {
             if(core.isClosed()) return;
-            Stat stat = zkSolrResourceLoader.getZkController().getZkClient().exists((zkSolrResourceLoader).getCollectionZkPath()
+ "/" + ConfigOverlay.RESOURCE_NAME, null, true);
+            Stat stat = zkSolrResourceLoader.getZkController().getZkClient().exists((zkSolrResourceLoader).getConfigSetZkPath()
+ "/" + ConfigOverlay.RESOURCE_NAME, null, true);
             if(stat == null) return;
             if (stat.getVersion() >  core.getSolrConfig().getOverlay().getZnodeVersion())
{
               core.getCoreDescriptor().getCoreContainer().reload(core.getName());
@@ -115,7 +115,7 @@ public class SolrConfigHandler extends R
         }
       };
 
-      zkSolrResourceLoader.getZkController().registerConfListenerForCore(zkSolrResourceLoader.getCollectionZkPath(),
core,listener);
+      zkSolrResourceLoader.getZkController().registerConfListenerForCore(zkSolrResourceLoader.getConfigSetZkPath(),
core,listener);
     }
 
   }

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/EditFileRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/EditFileRequestHandler.java?rev=1637296&r1=1637295&r2=1637296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/EditFileRequestHandler.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/EditFileRequestHandler.java
Fri Nov  7 06:39:26 2014
@@ -282,7 +282,7 @@ public class EditFileRequestHandler exte
 
       if (coreContainer.isZooKeeperAware()) {
         try {
-          String confPath = ((ZkSolrResourceLoader) core.getResourceLoader()).getCollectionZkPath();
+          String confPath = ((ZkSolrResourceLoader) core.getResourceLoader()).getConfigSetZkPath();
 
           ZkController.downloadConfigDir(coreContainer.getZkController().getZkClient(), confPath,
               new File(coll, "conf"));

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java?rev=1637296&r1=1637295&r2=1637296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java
Fri Nov  7 06:39:26 2014
@@ -304,7 +304,7 @@ public class ShowFileRequestHandler exte
 
     final ZkSolrResourceLoader loader = (ZkSolrResourceLoader) core
         .getResourceLoader();
-    String confPath = loader.getCollectionZkPath();
+    String confPath = loader.getConfigSetZkPath();
 
     String fname = req.getParams().get("file", null);
     if (fname == null) {

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/ManagedIndexSchema.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/ManagedIndexSchema.java?rev=1637296&r1=1637295&r2=1637296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/ManagedIndexSchema.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/ManagedIndexSchema.java Fri
Nov  7 06:39:26 2014
@@ -165,7 +165,7 @@ public final class ManagedIndexSchema ex
     final ZkSolrResourceLoader zkLoader = (ZkSolrResourceLoader)loader;
     final ZkController zkController = zkLoader.getZkController();
     final SolrZkClient zkClient = zkController.getZkClient();
-    final String managedSchemaPath = zkLoader.getCollectionZkPath() + "/" + managedSchemaResourceName;
+    final String managedSchemaPath = zkLoader.getConfigSetZkPath() + "/" + managedSchemaResourceName;
     boolean success = true;
     boolean schemaChangedInZk = false;
     try {

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/ManagedIndexSchemaFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/ManagedIndexSchemaFactory.java?rev=1637296&r1=1637295&r2=1637296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/ManagedIndexSchemaFactory.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/ManagedIndexSchemaFactory.java
Fri Nov  7 06:39:26 2014
@@ -119,7 +119,7 @@ public class ManagedIndexSchemaFactory e
     } else { // ZooKeeper
       final ZkSolrResourceLoader zkLoader = (ZkSolrResourceLoader)loader;
       final SolrZkClient zkClient = zkLoader.getZkController().getZkClient();
-      final String managedSchemaPath = zkLoader.getCollectionZkPath() + "/" + managedSchemaResourceName;
+      final String managedSchemaPath = zkLoader.getConfigSetZkPath() + "/" + managedSchemaResourceName;
       Stat stat = new Stat();
       try {
         // Attempt to load the managed schema
@@ -224,7 +224,7 @@ public class ManagedIndexSchemaFactory e
       SolrResourceLoader loader = config.getResourceLoader();
       if (loader instanceof ZkSolrResourceLoader) {
         ZkSolrResourceLoader zkLoader = (ZkSolrResourceLoader)loader;
-        String nonManagedSchemaPath = zkLoader.getCollectionZkPath() + "/" + resourceName;
+        String nonManagedSchemaPath = zkLoader.getConfigSetZkPath() + "/" + resourceName;
         try {
           exists = zkLoader.getZkController().pathExists(nonManagedSchemaPath);
         } catch (InterruptedException e) {
@@ -349,7 +349,7 @@ public class ManagedIndexSchemaFactory e
     } else {
       // Rename the non-managed schema znode in ZooKeeper
       ZkSolrResourceLoader zkLoader = (ZkSolrResourceLoader)loader;
-      final String nonManagedSchemaPath = zkLoader.getCollectionZkPath() + "/" + resourceName;
+      final String nonManagedSchemaPath = zkLoader.getConfigSetZkPath() + "/" + resourceName;
       try {
         ZkController zkController = zkLoader.getZkController();
         ZkCmdExecutor zkCmdExecutor = new ZkCmdExecutor(zkController.getClientTimeout());

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java?rev=1637296&r1=1637295&r2=1637296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java Fri
Nov  7 06:39:26 2014
@@ -43,7 +43,7 @@ public class ZkIndexSchemaReader impleme
     this.managedIndexSchemaFactory = managedIndexSchemaFactory;
     ZkSolrResourceLoader zkLoader = (ZkSolrResourceLoader)managedIndexSchemaFactory.getResourceLoader();
     this.zkClient = zkLoader.getZkController().getZkClient();
-    managedSchemaPath = zkLoader.getCollectionZkPath() + "/" + managedIndexSchemaFactory.getManagedSchemaResourceName();
+    managedSchemaPath = zkLoader.getConfigSetZkPath() + "/" + managedIndexSchemaFactory.getManagedSchemaResourceName();
     createSchemaWatcher();
     zkLoader.getZkController().addOnReconnectListener(this);
   }



Mime
View raw message