storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ar...@apache.org
Subject [1/3] storm git commit: STORM-1476 Filter -c options from args and add them as part of storm.options
Date Wed, 10 Feb 2016 06:06:53 GMT
Repository: storm
Updated Branches:
  refs/heads/master 53e44ff3d -> 5f1cba55a


STORM-1476 Filter -c options from args and add them as part of storm.options


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

Branch: refs/heads/master
Commit: 10b0d5842a12dbb772fb97fd26271d395396aa31
Parents: bc9e735
Author: Satish Duggana <sduggana@hortonworks.com>
Authored: Fri Jan 15 13:22:04 2016 +0530
Committer: Satish Duggana <sduggana@hortonworks.com>
Committed: Fri Jan 15 13:22:04 2016 +0530

----------------------------------------------------------------------
 bin/storm-config.cmd |  6 +++++-
 bin/storm.cmd        | 47 +++++++++++++++++++++++++++++++++++++++--------
 2 files changed, 44 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/10b0d584/bin/storm-config.cmd
----------------------------------------------------------------------
diff --git a/bin/storm-config.cmd b/bin/storm-config.cmd
index cb1e203..d2adb42 100644
--- a/bin/storm-config.cmd
+++ b/bin/storm-config.cmd
@@ -125,7 +125,11 @@ FOR /F "delims=" %%i in (%CMD_TEMP_FILE%) do (
 
 
 :storm_opts
- set STORM_OPTS=-Dstorm.options= -Dstorm.home=%STORM_HOME% -Djava.library.path=%JAVA_LIBRARY_PATH%;%JAVA_HOME%\bin;%JAVA_HOME%\lib;%JAVA_HOME%\jre\bin;%JAVA_HOME%\jre\lib
+ if "%set_storm_options%"=="true" (
+  set STORM_OPTS=-Dstorm.options=
+ )
+
+ set STORM_OPTS=%STORM_OPTS% -Dstorm.home=%STORM_HOME% -Djava.library.path=%JAVA_LIBRARY_PATH%;%JAVA_HOME%\bin;%JAVA_HOME%\lib;%JAVA_HOME%\jre\bin;%JAVA_HOME%\jre\lib
  set STORM_OPTS=%STORM_OPTS% -Dlog4j.configurationFile=%STORM_LOG4J2_CONFIGURATION_FILE%
  set STORM_OPTS=%STORM_OPTS% -Dstorm.log.dir=%STORM_LOG_DIR%
  del /F %CMD_TEMP_FILE%

http://git-wip-us.apache.org/repos/asf/storm/blob/10b0d584/bin/storm.cmd
----------------------------------------------------------------------
diff --git a/bin/storm.cmd b/bin/storm.cmd
index ee125e5..6f4e934 100644
--- a/bin/storm.cmd
+++ b/bin/storm.cmd
@@ -37,9 +37,14 @@
 :main
   setlocal enabledelayedexpansion
 
+  set storm-command=%1
+
+  if not "%storm-command%" == "jar" (
+    set set_storm_options=true
+  )
+
   call %~dp0storm-config.cmd
 
-  set storm-command=%1
   if not defined storm-command (
       goto print_usage
   )
@@ -66,19 +71,45 @@
   )
 
   if %storm-command% == jar (
-    set STORM_OPTS=%STORM_CLIENT_OPTS% %STORM_OPTS% -Dstorm.jar=%2
-    set CLASSPATH=%CLASSPATH%;%2
-    set CLASS=%3
-    set args=%4
+    set config-options=
+
     goto start
     :start
     shift
-    if [%4] == [] goto done
-    set args=%args% %4
+    if [%1] == [] goto done
+
+    if '%1'=='-c' (
+      set c-opt=first
+      goto start
+    )
+
+    if "%c-opt%"=="first" (
+      set config-options=%config-options%,%1
+      set c-opt=second
+      goto start
+    )
+
+    if "%c-opt%"=="second" (
+      set config-options=%config-options%=%1
+      set c-opt=
+      goto start
+    )
+
+    set args=%args% %1
     goto start
 
     :done
-    set storm-command-arguments=%args%
+    for /F "tokens=1,2,*" %%a in ("%args%") do (
+      set first-arg=%%a
+      set second-arg=%%b
+      set remaining-args=%%c
+    )
+    set STORM_OPTS=%STORM_CLIENT_OPTS% %STORM_OPTS% -Dstorm.jar=%first-arg%
+    set STORM_OPTS=%STORM_OPTS% -Dstorm.options=%config-options%
+    set CLASSPATH=%CLASSPATH%;%first-arg%
+    set CLASS=%second-arg%
+    set storm-command-arguments=%remaining-args%
+
   )
   
   if not defined STORM_LOG_FILE (


Mime
View raw message