@@ -53,7 +53,7 @@ def confvalue(name, extrapaths):
53
53
for line in lines :
54
54
tokens = line .split (" " )
55
55
if tokens [0 ] == "VALUE:" :
56
- return tokens [1 ]
56
+ return " " . join ( tokens [1 :])
57
57
58
58
def print_localconfvalue (name ):
59
59
print name + ": " + confvalue (name , [CONF_DIR ])
@@ -106,11 +106,12 @@ def nimbus():
106
106
107
107
def supervisor ():
108
108
cppaths = [STORM_DIR + "/log4j" , STORM_DIR + "/conf" ]
109
- childopts = confvalue ("nimbus .childopts" , cppaths ) + " -Dlogfile.name=supervisor.log -Dlog4j.configuration=storm.log.properties"
109
+ childopts = confvalue ("supervisor .childopts" , cppaths ) + " -Dlogfile.name=supervisor.log -Dlog4j.configuration=storm.log.properties"
110
110
exec_storm_class ("backtype.storm.daemon.supervisor" , jvmtype = "-server" , extrajars = cppaths , childopts = childopts )
111
111
112
112
def ui ():
113
- childopts = "-Xmx768m -Dlogfile.name=ui.log -Dlog4j.configuration=storm.log.properties"
113
+ cppaths = [STORM_DIR + "/log4j" , STORM_DIR + "/conf" ]
114
+ childopts = confvalue ("ui.childopts" , cppaths ) + " -Dlogfile.name=ui.log -Dlog4j.configuration=storm.log.properties"
114
115
exec_storm_class ("backtype.storm.ui.core" , jvmtype = "-server" , childopts = childopts , extrajars = [STORM_DIR + "/log4j" , STORM_DIR , STORM_DIR + "/conf" ])
115
116
116
117
def drpc ():
@@ -120,11 +121,6 @@ def drpc():
120
121
def print_classpath ():
121
122
print get_classpath ([])
122
123
123
- COMMANDS = {"jar" : jar , "kill" : kill , "shell" : shell , "nimbus" : nimbus , "ui" : ui ,
124
- "drpc" : drpc , "supervisor" : supervisor , "localconfvalue" : print_localconfvalue ,
125
- "remoteconfvalue" : print_remoteconfvalue , "repl" : repl , "classpath" : print_classpath ,
126
- "activate" : activate , "deactivate" : deactivate , "rebalance" : rebalance }
127
-
128
124
def print_commands ():
129
125
global COMMANDS
130
126
cmds = COMMANDS .keys ()
@@ -137,14 +133,19 @@ def print_usage(msg=None):
137
133
print msg
138
134
print_commands ()
139
135
136
+ COMMANDS = {"jar" : jar , "kill" : kill , "shell" : shell , "nimbus" : nimbus , "ui" : ui ,
137
+ "drpc" : drpc , "supervisor" : supervisor , "localconfvalue" : print_localconfvalue ,
138
+ "remoteconfvalue" : print_remoteconfvalue , "repl" : repl , "classpath" : print_classpath ,
139
+ "activate" : activate , "deactivate" : deactivate , "rebalance" : rebalance , "help" : print_usage }
140
+
140
141
def main ():
141
142
if len (sys .argv ) <= 1 :
142
143
print_usage ()
143
144
sys .exit (- 1 )
144
145
145
146
COMMAND = sys .argv [1 ]
146
147
ARGS = sys .argv [2 :]
147
- COMMANDS [ COMMAND ] (* ARGS )
148
+ ( COMMANDS . get ( COMMAND , "help" )) (* ARGS )
148
149
149
150
if __name__ == "__main__" :
150
151
main ()
0 commit comments