You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2014/05/21 17:27:36 UTC

[6/8] git commit: STORM-308 Add support for config_value to {supervisor, nimbus, ui, drpc, logviewer} childopts

STORM-308 Add support for config_value to {supervisor,nimbus,ui,drpc,logviewer} childopts

Modified code that uses nested loop to fetch the childopts value from storm.yaml file and used single CHILDOPTS variable to hold the value.

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

Branch: refs/heads/master
Commit: 358d5d0126fc1834861420bc30839f4ab37ecfe4
Parents: f55f766
Author: ChitturiPadma <pa...@gmail.com>
Authored: Tue May 13 17:02:17 2014 +0530
Committer: ChitturiPadma <pa...@gmail.com>
Committed: Tue May 13 17:02:17 2014 +0530

----------------------------------------------------------------------
 bin/storm.cmd | 62 +++++++++++++++++++++++++++++++-----------------------
 1 file changed, 36 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/358d5d01/bin/storm.cmd
----------------------------------------------------------------------
diff --git a/bin/storm.cmd b/bin/storm.cmd
index 134a152..17c01d6 100644
--- a/bin/storm.cmd
+++ b/bin/storm.cmd
@@ -106,12 +106,13 @@
 :drpc
   set CLASS=backtype.storm.daemon.drpc
   %JAVA% -client -Dstorm.options= -Dstorm.conf.file= -cp %CLASSPATH% backtype.storm.command.config_value drpc.childopts > temp.txt
-  FOR /F "tokens=1,* delims= " %%i in (temp.txt) do (
-     if %%i == VALUE: (
- 	set DRPC_CHILDOPTS=%%j )
-   )
-  del /F temp.txt
-  set STORM_OPTS=%STORM_SERVER_OPTS% %STORM_OPTS% %DRPC_CHILDOPTS%
+  FOR /F "delims=" %%i in (temp.txt) do (
+     FOR /F "tokens=1,* delims= " %%a in ("%%i") do (
+	  if %%a == VALUE: (
+	   set CHILDOPTS=%%b
+	   call :set_childopts)
+    )
+  )
   goto :eof
 
 :help
@@ -131,23 +132,25 @@
 :logviewer
   set CLASS=backtype.storm.daemon.logviewer
    %JAVA% -client -Dstorm.options= -Dstorm.conf.file= -cp %CLASSPATH% backtype.storm.command.config_value logviewer.childopts > temp.txt
-  FOR /F "tokens=1,* delims= " %%i in (temp.txt) do (
- 	if %%i == VALUE: (
- 	set LOGVIEWER_CHILDOPTS=%%j )
+  FOR /F "delims=" %%i in (temp.txt) do (
+     FOR /F "tokens=1,* delims= " %%a in ("%%i") do (
+	  if %%a == VALUE: (
+	   set CHILDOPTS=%%b
+	   call :set_childopts)
+    )
   )
-  del /F temp.txt
-  set STORM_OPTS=%STORM_SERVER_OPTS% %STORM_OPTS% %LOGVIEWER_CHILDOPTS%
   goto :eof
 
 :nimbus
   set CLASS=backtype.storm.daemon.nimbus
   %JAVA% -client -Dstorm.options= -Dstorm.conf.file= -cp %CLASSPATH% backtype.storm.command.config_value nimbus.childopts > temp.txt
-    FOR /F "tokens=1,* delims= " %%i in (temp.txt) do (
- 	if %%i == VALUE: (
- 	set NIMBUS_CHILDOPTS=%%j )
+  FOR /F "delims=" %%i in (temp.txt) do (
+     FOR /F "tokens=1,* delims= " %%a in ("%%i") do (
+	  if %%a == VALUE: (
+	   set CHILDOPTS=%%b
+	   call :set_childopts)
+    )
   )
-  del /F temp.txt
-  set STORM_OPTS=%STORM_SERVER_OPTS% %STORM_OPTS% %NIMBUS_CHILDOPTS%
   goto :eof
 
 :rebalance
@@ -168,24 +171,26 @@
 :supervisor
   set CLASS=backtype.storm.daemon.supervisor
   %JAVA% -client -Dstorm.options= -Dstorm.conf.file= -cp %CLASSPATH% backtype.storm.command.config_value supervisor.childopts > temp.txt
-  FOR /F "tokens=1,* delims= " %%i in (temp.txt) do (
- 	if %%i == VALUE: (
- 	set SUPERVISOR_CHILDOPTS=%%j )
+  FOR /F "delims=" %%i in (temp.txt) do (
+     FOR /F "tokens=1,* delims= " %%a in ("%%i") do (
+	  if %%a == VALUE: (
+	   set CHILDOPTS=%%b
+	   call :set_childopts)
+    )
   )
-  del /F temp.txt
-  set STORM_OPTS=%STORM_SERVER_OPTS% %STORM_OPTS% %SUPERVISOR_CHILDOPTS%
   goto :eof
 
 :ui
   set CLASS=backtype.storm.ui.core
   set CLASSPATH=%CLASSPATH%;%STORM_HOME%
   %JAVA% -client -Dstorm.options= -Dstorm.conf.file= -cp %CLASSPATH% backtype.storm.command.config_value ui.childopts > temp.txt
-  FOR /F "tokens=1,* delims= " %%i in (temp.txt) do (
- 	if %%i == VALUE: (
- 	set UI_CHILDOPTS=%%j )
+  FOR /F "delims=" %%i in (temp.txt) do (
+     FOR /F "tokens=1,* delims= " %%a in ("%%i") do (
+	  if %%a == VALUE: (
+	   set CHILDOPTS=%%b
+	   call :set_childopts)
+    )
   )
-  del /F temp.txt
-  set STORM_OPTS=%STORM_SERVER_OPTS% %STORM_OPTS% %UI_CHILDOPTS%
   goto :eof
 
 :version
@@ -208,6 +213,11 @@
   )
   set storm-command-arguments=%_arguments%
   goto :eof
+  
+:set_childopts
+  set STORM_OPTS=%STORM_SERVER_OPTS% %STORM_OPTS% %CHILDOPTS%
+  del /F temp.txt
+  goto :eof
 
 :print_usage
   @echo Usage: storm COMMAND