You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by is...@apache.org on 2017/06/21 11:25:30 UTC

lucene-solr:jira/solr-10574: SOLR-10574: Tests and SolrCLI changes for _default configset

Repository: lucene-solr
Updated Branches:
  refs/heads/jira/solr-10574 0ec9d64d8 -> e7be3c8ed


SOLR-10574: Tests and SolrCLI changes for _default configset


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/e7be3c8e
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/e7be3c8e
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/e7be3c8e

Branch: refs/heads/jira/solr-10574
Commit: e7be3c8ed570379f6261b6cb89086369bd981983
Parents: 0ec9d64
Author: Ishan Chattopadhyaya <is...@apache.org>
Authored: Wed Jun 21 11:24:48 2017 +0000
Committer: Ishan Chattopadhyaya <is...@apache.org>
Committed: Wed Jun 21 11:24:48 2017 +0000

----------------------------------------------------------------------
 solr/core/src/java/org/apache/solr/util/SolrCLI.java     |  8 ++++----
 .../test/org/apache/solr/cloud/SolrCloudExampleTest.java | 11 ++++++-----
 .../test/org/apache/solr/util/TestSolrCLIRunExample.java |  2 +-
 solr/server/solr/configsets/_default/conf/solrconfig.xml |  6 +++---
 .../org/apache/solr/common/cloud/ZkConfigManager.java    |  2 +-
 .../solr/client/solrj/SolrSchemalessExampleTest.java     |  2 +-
 .../src/java/org/apache/solr/util/ExternalPaths.java     |  4 ++--
 7 files changed, 18 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e7be3c8e/solr/core/src/java/org/apache/solr/util/SolrCLI.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/SolrCLI.java b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
index 51ab5d7..736b4d7 100644
--- a/solr/core/src/java/org/apache/solr/util/SolrCLI.java
+++ b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
@@ -993,7 +993,7 @@ public class SolrCLI {
     }
   } // end ApiTool class
 
-  private static final String DEFAULT_CONFIG_SET = "data_driven_schema_configs";
+  private static final String DEFAULT_CONFIG_SET = "_default";
 
   private static final long MS_IN_MIN = 60 * 1000L;
   private static final long MS_IN_HOUR = MS_IN_MIN * 60L;
@@ -2681,7 +2681,7 @@ public class SolrCLI {
       File exDir = setupExampleDir(serverDir, exampleDir, exampleName);
       String collectionName = "schemaless".equals(exampleName) ? "gettingstarted" : exampleName;
       String configSet =
-          "techproducts".equals(exampleName) ? "sample_techproducts_configs" : "data_driven_schema_configs";
+          "techproducts".equals(exampleName) ? "sample_techproducts_configs" : "_default";
 
       boolean isCloudMode = cli.hasOption('c');
       String zkHost = cli.getOptionValue('z');
@@ -3054,7 +3054,7 @@ public class SolrCLI {
       // yay! numNodes SolrCloud nodes running
       int numShards = 2;
       int replicationFactor = 2;
-      String cloudConfig = "data_driven_schema_configs";
+      String cloudConfig = "_default";
       String collectionName = "gettingstarted";
 
       File configsetsDir = new File(serverDir, "solr/configsets");
@@ -3089,7 +3089,7 @@ public class SolrCLI {
             "How many replicas per shard would you like to create? [2] ", "a replication factor", 2, 1, 4);
 
         echo("Please choose a configuration for the "+collectionName+" collection, available options are:");
-        String validConfigs = "basic_configs, data_driven_schema_configs, or sample_techproducts_configs ["+cloudConfig+"] ";
+        String validConfigs = "_default or sample_techproducts_configs ["+cloudConfig+"] ";
         cloudConfig = prompt(readInput, validConfigs, cloudConfig);
 
         // validate the cloudConfig name

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e7be3c8e/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java b/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
index 5e98f05..2b79408 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
@@ -55,7 +55,8 @@ import static org.apache.solr.common.util.Utils.getObjectByPath;
 /**
  * Emulates bin/solr -e cloud -noprompt; bin/post -c gettingstarted example/exampledocs/*.xml;
  * this test is useful for catching regressions in indexing the example docs in collections that
- * use data-driven schema and managed schema features provided by configsets/data_driven_schema_configs.
+ * use data driven functionality and managed schema features of the default configset
+ * (configsets/_default).
  */
 public class SolrCloudExampleTest extends AbstractFullDistribZkTestBase {
 
@@ -73,8 +74,8 @@ public class SolrCloudExampleTest extends AbstractFullDistribZkTestBase {
     log.info("testLoadDocsIntoGettingStartedCollection initialized OK ... running test logic");
 
     String testCollectionName = "gettingstarted";
-    File data_driven_schema_configs = new File(ExternalPaths.SCHEMALESS_CONFIGSET);
-    assertTrue(data_driven_schema_configs.getAbsolutePath()+" not found!", data_driven_schema_configs.isDirectory());
+    File defaultConfigs = new File(ExternalPaths.DEFAULT_CONFIGSET);
+    assertTrue(defaultConfigs.getAbsolutePath()+" not found!", defaultConfigs.isDirectory());
 
     Set<String> liveNodes = cloudClient.getZkStateReader().getClusterState().getLiveNodes();
     if (liveNodes.isEmpty())
@@ -88,8 +89,8 @@ public class SolrCloudExampleTest extends AbstractFullDistribZkTestBase {
         "-shards", "2",
         "-replicationFactor", "2",
         "-confname", testCollectionName,
-        "-confdir", "data_driven_schema_configs",
-        "-configsetsDir", data_driven_schema_configs.getParentFile().getParentFile().getAbsolutePath(),
+        "-confdir", "_default",
+        "-configsetsDir", defaultConfigs.getParentFile().getParentFile().getAbsolutePath(),
         "-solrUrl", solrUrl
     };
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e7be3c8e/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
index 86554b5..0c2421f 100644
--- a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
+++ b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
@@ -418,7 +418,7 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
 
     // sthis test only support launching one SolrCloud node due to how MiniSolrCloudCluster works
     // and the need for setting the host and port system properties ...
-    String userInput = "1\n"+bindPort+"\n"+collectionName+"\n2\n2\ndata_driven_schema_configs\n";
+    String userInput = "1\n"+bindPort+"\n"+collectionName+"\n2\n2\n_default\n";
 
     // simulate user input from stdin
     InputStream userInputSim = new ByteArrayInputStream(userInput.getBytes(StandardCharsets.UTF_8));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e7be3c8e/solr/server/solr/configsets/_default/conf/solrconfig.xml
----------------------------------------------------------------------
diff --git a/solr/server/solr/configsets/_default/conf/solrconfig.xml b/solr/server/solr/configsets/_default/conf/solrconfig.xml
index 1b55374..0abb2e1 100644
--- a/solr/server/solr/configsets/_default/conf/solrconfig.xml
+++ b/solr/server/solr/configsets/_default/conf/solrconfig.xml
@@ -1220,16 +1220,16 @@
     </lst>
     <lst name="typeMapping">
       <str name="valueClass">java.util.Date</str>
-      <str name="fieldType">tdates</str>
+      <str name="fieldType">pdates</str>
     </lst>
     <lst name="typeMapping">
       <str name="valueClass">java.lang.Long</str>
       <str name="valueClass">java.lang.Integer</str>
-      <str name="fieldType">tlongs</str>
+      <str name="fieldType">plongs</str>
     </lst>
     <lst name="typeMapping">
       <str name="valueClass">java.lang.Number</str>
-      <str name="fieldType">tdoubles</str>
+      <str name="fieldType">pdoubles</str>
     </lst>
   </updateProcessor>
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e7be3c8e/solr/solrj/src/java/org/apache/solr/common/cloud/ZkConfigManager.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkConfigManager.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkConfigManager.java
index 0b3608b..312cb90 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkConfigManager.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkConfigManager.java
@@ -186,7 +186,7 @@ public class ZkConfigManager {
   
   // Order is important here since "confDir" may be
   // 1> a full path to the parent of a solrconfig.xml or parent of /conf/solrconfig.xml
-  // 2> one of the canned config sets only, e.g. basic_configs
+  // 2> one of the canned config sets only, e.g. _default
   // and trying to assemble a path for configsetDir/confDir is A Bad Idea. if confDir is a full path.
   
   public static Path getConfigsetPath(String confDir, String configSetDir) throws IOException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e7be3c8e/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java
index 3d553d8..a7b4619 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java
@@ -51,7 +51,7 @@ public class SolrSchemalessExampleTest extends SolrExampleTestsBase {
     FileUtils.copyFileToDirectory(new File(ExternalPaths.SERVER_HOME, "solr.xml"), tempSolrHome);
     File collection1Dir = new File(tempSolrHome, "collection1");
     FileUtils.forceMkdir(collection1Dir);
-    FileUtils.copyDirectoryToDirectory(new File(ExternalPaths.SCHEMALESS_CONFIGSET), collection1Dir);
+    FileUtils.copyDirectoryToDirectory(new File(ExternalPaths.DEFAULT_CONFIGSET), collection1Dir);
     Properties props = new Properties();
     props.setProperty("name","collection1");
     OutputStreamWriter writer = null;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e7be3c8e/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java
----------------------------------------------------------------------
diff --git a/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java b/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java
index e5a83ef..fb70862 100644
--- a/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java
+++ b/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java
@@ -41,8 +41,8 @@ public class ExternalPaths {
   /* @see #SOURCE_HOME */
   public static String WEBAPP_HOME = new File(SOURCE_HOME, "webapp/web").getAbsolutePath();
   /* @see #SOURCE_HOME */
-  public static String SCHEMALESS_CONFIGSET =
-      new File(SOURCE_HOME, "server/solr/configsets/data_driven_schema_configs/conf").getAbsolutePath();
+  public static String DEFAULT_CONFIGSET =
+      new File(SOURCE_HOME, "server/solr/configsets/_default/conf").getAbsolutePath();
   public static String TECHPRODUCTS_CONFIGSET =
       new File(SOURCE_HOME, "server/solr/configsets/sample_techproducts_configs/conf").getAbsolutePath();