You are viewing a plain text version of this content. The canonical link for it is here.
Posted to s4-commits@incubator.apache.org by mm...@apache.org on 2012/07/23 16:16:14 UTC

[2/2] git commit: tools syntax improvements - removed curly braces - comma separated list for extra modules classes

tools syntax improvements
- removed curly braces
- comma separated list for extra modules classes


Project: http://git-wip-us.apache.org/repos/asf/incubator-s4/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-s4/commit/9b0f8112
Tree: http://git-wip-us.apache.org/repos/asf/incubator-s4/tree/9b0f8112
Diff: http://git-wip-us.apache.org/repos/asf/incubator-s4/diff/9b0f8112

Branch: refs/heads/piper
Commit: 9b0f81124e96205349db4fba24417b929f287686
Parents: 6f8ad92
Author: Matthieu Morel <mm...@apache.org>
Authored: Fri Jul 20 10:11:35 2012 +0200
Committer: Matthieu Morel <mm...@apache.org>
Committed: Fri Jul 20 10:11:35 2012 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/s4/core/Main.java     |    7 ++++---
 .../main/java/org/apache/s4/tools/ZKServer.java    |    8 ++++----
 2 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/9b0f8112/subprojects/s4-core/src/main/java/org/apache/s4/core/Main.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/main/java/org/apache/s4/core/Main.java b/subprojects/s4-core/src/main/java/org/apache/s4/core/Main.java
index 5f1375b..ea7cfd6 100644
--- a/subprojects/s4-core/src/main/java/org/apache/s4/core/Main.java
+++ b/subprojects/s4-core/src/main/java/org/apache/s4/core/Main.java
@@ -136,6 +136,7 @@ public class Main {
             }
         } catch (Exception e) {
             logger.error("Cannot start S4 node", e);
+            System.exit(1);
         }
     }
 
@@ -160,10 +161,10 @@ public class Main {
         @Parameter(names = "-appClass", description = "App class to load. This will disable dynamic downloading but allows to start apps directly. These app classes must have been loaded first, usually through a custom module.", required = false, hidden = true)
         String appClass = null;
 
-        @Parameter(names = "-extraModulesClasses", description = "additional configuration modules (they will be instantiated through their constructor without arguments).", variableArity = true, required = false, hidden = true)
+        @Parameter(names = { "-extraModulesClasses", "-emc" }, description = "Comma-separated list of additional configuration modules (they will be instantiated through their constructor without arguments).", required = false, hidden = false)
         List<String> extraModulesClasses = new ArrayList<String>();
 
-        @Parameter(names = { "-namedStringParameters", "-p" }, description = "Inline configuration parameters, taking precedence over homonymous configuration parameters from configuration files. Syntax: '-namedStringParameters={name1=value1},{name2=value2} '", hidden = false, converter = InlineConfigParameterConverter.class)
+        @Parameter(names = { "-namedStringParameters", "-p" }, description = "Comma-separated list of inline configuration parameters, taking precedence over homonymous configuration parameters from configuration files. Syntax: '-p=name1=value1,name2=value2 '", hidden = false, converter = InlineConfigParameterConverter.class)
         List<String> extraNamedParameters = new ArrayList<String>();
 
         @Parameter(names = "-zk", description = "Zookeeper connection string", required = false)
@@ -175,7 +176,7 @@ public class Main {
 
         @Override
         public String convert(String arg) {
-            Pattern parameterPattern = Pattern.compile("\\{(\\S+=\\S+)\\}");
+            Pattern parameterPattern = Pattern.compile("(\\S+=\\S+)");
             logger.info("processing inline configuration parameter {}", arg);
             Matcher parameterMatcher = parameterPattern.matcher(arg);
             if (!parameterMatcher.find()) {

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/9b0f8112/subprojects/s4-tools/src/main/java/org/apache/s4/tools/ZKServer.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-tools/src/main/java/org/apache/s4/tools/ZKServer.java b/subprojects/s4-tools/src/main/java/org/apache/s4/tools/ZKServer.java
index 668499a..d473065 100644
--- a/subprojects/s4-tools/src/main/java/org/apache/s4/tools/ZKServer.java
+++ b/subprojects/s4-tools/src/main/java/org/apache/s4/tools/ZKServer.java
@@ -96,11 +96,11 @@ public class ZKServer {
         String logDir = new File(System.getProperty("java.io.tmpdir") + File.separator + "tmp" + File.separator
                 + "zookeeper" + File.separator + "log").getAbsolutePath();
 
-        @Parameter(names = { "-t", "-testMode" }, description = "Launch Zookeeper instance and load a default cluster configuration for easy testing (2 clusters with following configs: {"
-                + TEST_MODE_CLUSTER_CONF_1 + "} and {" + TEST_MODE_CLUSTER_CONF_2 + "}")
+        @Parameter(names = { "-t", "-testMode" }, description = "Launch Zookeeper instance and load a default cluster configuration for easy testing (2 clusters with following configs: "
+                + TEST_MODE_CLUSTER_CONF_1 + " and " + TEST_MODE_CLUSTER_CONF_2 + "")
         boolean testMode = false;
 
-        @Parameter(names = "-clusters", description = "Inline clusters configuration, comma-separated list of curly-braces enclosed cluster definitions with format: {c=<cluster name>:flp=<first listening port for this cluster>:nbTasks=<number of tasks>} (Overrides default configuration for test mode)", converter = ClusterConfigsConverter.class)
+        @Parameter(names = "-clusters", description = "Inline clusters configuration, comma-separated list of cluster definitions with format: c=<cluster name>:flp=<first listening port for this cluster>:nbTasks=<number of tasks> (Overrides default configuration for test mode)", converter = ClusterConfigsConverter.class)
         List<ClusterConfig> clusterConfigs;
 
     }
@@ -109,7 +109,7 @@ public class ZKServer {
 
         @Override
         public ClusterConfig convert(String arg) {
-            Pattern clusterConfigPattern = Pattern.compile("\\{(c=\\w+[:]flp=\\d+[:]nbTasks=\\d+)\\}");
+            Pattern clusterConfigPattern = Pattern.compile("(c=\\w+[:]flp=\\d+[:]nbTasks=\\d+)");
             logger.info("processing cluster configuration {}", arg);
             Matcher configMatcher = clusterConfigPattern.matcher(arg);
             if (!configMatcher.find()) {