前面几篇周报都是代码实现相关的。现在代码部分已经结束,所以来总结一下项目中其它相关部分的文档。
在已经实现了jstorm-yarn launch命令后,我开始思考去实现其它的命令。以下为jstorm-yarn help的输出:
jstorm-yarn help
usage: addSupervisors
-appId <arg> (Required) The storm clusters app ID
-output <arg> Output file
-supervisors <arg> (Required for addSupervisors) The # of supervisors to be added
usage: startSupervisors
-appId <arg> (Required) The storm clusters app ID
-output <arg> Output file
-supervisors <arg> (Required for addSupervisors) The # of supervisors to be added
usage: startNimbus
-appId <arg> (Required) The storm clusters app ID
-output <arg> Output file
-supervisors <arg> (Required for addSupervisors) The # of supervisors to be added
usage: stopSupervisors
-appId <arg> (Required) The storm clusters app ID
-output <arg> Output file
-supervisors <arg> (Required for addSupervisors) The # of supervisors to be added
usage: getStormConfig
-appId <arg> (Required) The storm clusters app ID
-output <arg> Output file
-supervisors <arg> (Required for addSupervisors) The # of supervisors to be added
usage: launch
jstorm-yarn launch <master.yaml>
-appname <arg> Application Name. Default value - JStorm-on-Yarn
-jstormConfOutput <arg> storm.yaml file
-jstormHome <arg> JStorm Home Directory
-jstormZip <arg> file path of jstorm.zip
-output <arg> Output file
-queue <arg> RM Queue in which this application is to be submitted
usage: stopNimbus
-appId <arg> (Required) The storm clusters app ID
-output <arg> Output file
-supervisors <arg> (Required for addSupervisors) The # of supervisors to be added
usage: setStormConfig
-appId <arg> (Required) The storm clusters app ID
-output <arg> Output file
-supervisors <arg> (Required for addSupervisors) The # of supervisors to be added
usage: version
jstorm-yarn version
usage: shutdown
-appId <arg> (Required) The storm clusters app ID
-output <arg> Output file
-supervisors <arg> (Required for addSupervisors) The # of supervisors to be added
输出格式参考storm-yarn中使用HelpFormatter进行格式化输出,使得代码更加简洁易懂,在以后用java解析程序命令时可采用这个,很方便。具体例子可参考 http://www.programcreek.com/java-api-examples/index.php?api=org.apache.commons.cli.HelpFormatter