storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [2/4] git commit: Updated encoding to be standards based and generic.
Date Fri, 25 Apr 2014 15:41:15 GMT
Updated encoding to be standards based and generic.


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

Branch: refs/heads/master
Commit: d646c4bfe1c551a14b0784220a7c12d9bb7a1b94
Parents: 01d4863
Author: Robert (Bobby) Evans <evans@yahoo-inc.com>
Authored: Wed Apr 23 22:03:52 2014 +0000
Committer: Robert (Bobby) Evans <evans@yahoo-inc.com>
Committed: Wed Apr 23 22:03:52 2014 +0000

----------------------------------------------------------------------
 bin/storm                                          | 3 ++-
 storm-core/src/jvm/backtype/storm/utils/Utils.java | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/d646c4bf/bin/storm
----------------------------------------------------------------------
diff --git a/bin/storm b/bin/storm
index 82ea7c4..bb6e40a 100755
--- a/bin/storm
+++ b/bin/storm
@@ -23,6 +23,7 @@ import subprocess as sub
 import getopt
 import re
 import shlex
+import urllib
 
 def identity(x):
     return x
@@ -51,7 +52,7 @@ JAR_JVM_OPTS = shlex.split(os.getenv('STORM_JAR_JVM_OPTS', ''))
 
 def get_config_opts():
     global CONFIG_OPTS
-    return "-Dstorm.options=" + (','.join(map(lambda x: x.replace(',',"%%comma%%"),CONFIG_OPTS))).replace('
', "%%%%")
+    return "-Dstorm.options=" + ','.join(map(urllib.quote_plus,CONFIG_OPTS))
 
 if not os.path.exists(STORM_DIR + "/RELEASE"):
     print "******************************************"

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/d646c4bf/storm-core/src/jvm/backtype/storm/utils/Utils.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/utils/Utils.java b/storm-core/src/jvm/backtype/storm/utils/Utils.java
index dba987c..70884d6 100644
--- a/storm-core/src/jvm/backtype/storm/utils/Utils.java
+++ b/storm-core/src/jvm/backtype/storm/utils/Utils.java
@@ -26,6 +26,7 @@ import java.io.InputStreamReader;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.net.URL;
+import java.net.URLDecoder;
 import java.nio.ByteBuffer;
 import java.nio.channels.Channels;
 import java.nio.channels.WritableByteChannel;
@@ -168,10 +169,9 @@ public class Utils {
         Map ret = new HashMap();
         String commandOptions = System.getProperty("storm.options");
         if(commandOptions != null) {
-            commandOptions = commandOptions.replaceAll("%%%%", " ");
             String[] configs = commandOptions.split(",");
             for (String config : configs) {
-                config = config.replaceAll("%%comma%%", " ");
+                config = URLDecoder.decode(config);
                 String[] options = config.split("=", 2);
                 if (options.length == 2) {
                     Object val = JSONValue.parse(options[1]);


Mime
View raw message