You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by cp...@apache.org on 2016/04/15 18:08:01 UTC

lucene-solr:branch_5x: SOLR-8938: add -x as short-form of --excluderegex ZkCLI arg

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_5x ddccac85c -> 9d86d2ec4


SOLR-8938: add -x as short-form of --excluderegex ZkCLI arg


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

Branch: refs/heads/branch_5x
Commit: 9d86d2ec41e18d6a2e48ffe157160a54794cc45a
Parents: ddccac8
Author: Christine Poerschke <cp...@apache.org>
Authored: Fri Apr 15 15:52:53 2016 +0100
Committer: Christine Poerschke <cp...@apache.org>
Committed: Fri Apr 15 16:40:38 2016 +0100

----------------------------------------------------------------------
 solr/CHANGES.txt                                        | 2 +-
 solr/core/src/java/org/apache/solr/cloud/ZkCLI.java     | 3 ++-
 solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java | 4 +++-
 3 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9d86d2ec/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index b2bbc15..bdf225b 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -17,7 +17,7 @@ New Features
 * SOLR-5730: Make Lucene's SortingMergePolicy and EarlyTerminatingSortingCollector configurable in Solr.
   (Christine Poerschke, hossmann, Tomás Fernández Löbbe, Shai Erera)
 
-* SOLR-8938: Add optional -excluderegex argument to ZkCLI. (Christine Poerschke)
+* SOLR-8938: Add optional --excluderegex argument to ZkCLI. (Christine Poerschke)
 
 Other Changes
 ----------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9d86d2ec/solr/core/src/java/org/apache/solr/cloud/ZkCLI.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkCLI.java b/solr/core/src/java/org/apache/solr/cloud/ZkCLI.java
index 5e3ddbb..9ba7cef 100644
--- a/solr/core/src/java/org/apache/solr/cloud/ZkCLI.java
+++ b/solr/core/src/java/org/apache/solr/cloud/ZkCLI.java
@@ -68,6 +68,7 @@ public class ZkCLI {
   private static final String SOLRHOME = "solrhome";
   private static final String BOOTSTRAP = "bootstrap";
   static final String UPCONFIG = "upconfig";
+  static final String EXCLUDE_REGEX_SHORT = "x";
   static final String EXCLUDE_REGEX = "excluderegex";
   static final String EXCLUDE_REGEX_DEFAULT = ZkConfigManager.UPLOAD_FILENAME_EXCLUDE_REGEX;
   private static final String COLLECTION = "collection";
@@ -123,7 +124,7 @@ public class ZkCLI {
     options.addOption("c", COLLECTION, true,
         "for " + LINKCONFIG + ": name of the collection");
     
-    options.addOption(EXCLUDE_REGEX, true,
+    options.addOption(EXCLUDE_REGEX_SHORT, EXCLUDE_REGEX, true,
         "for " + UPCONFIG + ": files matching this regular expression won't be uploaded");
 
     options

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9d86d2ec/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java b/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java
index 81b810b..1109f9e 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java
@@ -103,6 +103,7 @@ public class ZkCLITest extends SolrTestCaseJ4 {
   @Test
   public void testCmdConstants() throws Exception {
     assertEquals("upconfig", ZkCLI.UPCONFIG);
+    assertEquals("x", ZkCLI.EXCLUDE_REGEX_SHORT);
     assertEquals("excluderegex", ZkCLI.EXCLUDE_REGEX);
     assertEquals(ZkConfigManager.UPLOAD_FILENAME_EXCLUDE_REGEX, ZkCLI.EXCLUDE_REGEX_DEFAULT);
   }
@@ -208,10 +209,11 @@ public class ZkCLITest extends SolrTestCaseJ4 {
           "-confdir", ExternalPaths.TECHPRODUCTS_CONFIGSET,
           "-confname", confsetname};
     } else {
+      final String excluderegexOption = (random().nextBoolean() ? "--"+ZkCLI.EXCLUDE_REGEX : "-"+ZkCLI.EXCLUDE_REGEX_SHORT);
       upconfigArgs = new String[] {
           "-zkhost", zkServer.getZkAddress(),
           "-cmd", ZkCLI.UPCONFIG,
-          "-"+ZkCLI.EXCLUDE_REGEX, ZkCLI.EXCLUDE_REGEX_DEFAULT,
+          excluderegexOption, ZkCLI.EXCLUDE_REGEX_DEFAULT,
           "-confdir", ExternalPaths.TECHPRODUCTS_CONFIGSET,
           "-confname", confsetname};
     }