Class: Commands::StepCommand
Direct Known Subclasses
EnableDebuggingCommand, HiveCommand, JarStepCommand, JsonStepCommand, PigInteractiveCommand, PigScriptCommand, ResizeJobflowCommand, StreamStepCommand
Instance Attribute Summary collapse
-
#apps_path ⇒ Object
Returns the value of attribute apps_path.
-
#args ⇒ Object
Returns the value of attribute args.
-
#beta_path ⇒ Object
Returns the value of attribute beta_path.
-
#enable_debugging_path ⇒ Object
Returns the value of attribute enable_debugging_path.
-
#hive_cmd ⇒ Object
Returns the value of attribute hive_cmd.
-
#hive_path ⇒ Object
Returns the value of attribute hive_path.
-
#pig_cmd ⇒ Object
Returns the value of attribute pig_cmd.
-
#pig_path ⇒ Object
Returns the value of attribute pig_path.
-
#script_runner_path ⇒ Object
Returns the value of attribute script_runner_path.
-
#step_action ⇒ Object
Returns the value of attribute step_action.
-
#step_name ⇒ Object
Returns the value of attribute step_name.
Attributes inherited from Command
#arg, #commands, #description, #logger, #name
Instance Method Summary collapse
- #default_enable_debugging_path ⇒ Object
- #default_hive_cmd ⇒ Object
- #default_hive_path ⇒ Object
- #default_pig_cmd ⇒ Object
- #default_pig_path ⇒ Object
- #default_resize_jobflow_cmd ⇒ Object
- #default_script_runner_path ⇒ Object
- #ensure_install_cmd(jobflow, sc, install_step_class) ⇒ Object
- #extra_args ⇒ Object
-
#initialize(*args) ⇒ StepCommand
constructor
A new instance of StepCommand.
- #reorder_steps(jobflow, sc) ⇒ Object
- #script_args ⇒ Object
- #validate ⇒ Object
Methods inherited from Command
#enact, #get_field, #has_value, #have, #option, #require, #require_single_jobflow, #resolve
Constructor Details
#initialize(*args) ⇒ StepCommand
Returns a new instance of StepCommand.
213 214 215 216 |
# File 'lib/commands.rb', line 213 def initialize(*args) super(*args) @args = [] end |
Instance Attribute Details
#apps_path ⇒ Object
Returns the value of attribute apps_path.
210 211 212 |
# File 'lib/commands.rb', line 210 def apps_path @apps_path end |
#args ⇒ Object
Returns the value of attribute args.
210 211 212 |
# File 'lib/commands.rb', line 210 def args @args end |
#beta_path ⇒ Object
Returns the value of attribute beta_path.
210 211 212 |
# File 'lib/commands.rb', line 210 def beta_path @beta_path end |
#enable_debugging_path ⇒ Object
Returns the value of attribute enable_debugging_path.
211 212 213 |
# File 'lib/commands.rb', line 211 def enable_debugging_path @enable_debugging_path end |
#hive_cmd ⇒ Object
Returns the value of attribute hive_cmd.
211 212 213 |
# File 'lib/commands.rb', line 211 def hive_cmd @hive_cmd end |
#hive_path ⇒ Object
Returns the value of attribute hive_path.
211 212 213 |
# File 'lib/commands.rb', line 211 def hive_path @hive_path end |
#pig_cmd ⇒ Object
Returns the value of attribute pig_cmd.
211 212 213 |
# File 'lib/commands.rb', line 211 def pig_cmd @pig_cmd end |
#pig_path ⇒ Object
Returns the value of attribute pig_path.
211 212 213 |
# File 'lib/commands.rb', line 211 def pig_path @pig_path end |
#script_runner_path ⇒ Object
Returns the value of attribute script_runner_path.
211 212 213 |
# File 'lib/commands.rb', line 211 def script_runner_path @script_runner_path end |
#step_action ⇒ Object
Returns the value of attribute step_action.
210 211 212 |
# File 'lib/commands.rb', line 210 def step_action @step_action end |
#step_name ⇒ Object
Returns the value of attribute step_name.
210 211 212 |
# File 'lib/commands.rb', line 210 def step_name @step_name end |
Instance Method Details
#default_enable_debugging_path ⇒ Object
244 245 246 |
# File 'lib/commands.rb', line 244 def default_enable_debugging_path File.join(get_field(:apps_path), "libs/state-pusher/0.1") end |
#default_hive_cmd ⇒ Object
235 236 237 238 |
# File 'lib/commands.rb', line 235 def default_hive_cmd [ File.join(get_field(:hive_path), "hive-script"), "--base-path", get_field(:hive_path) ] end |
#default_hive_path ⇒ Object
231 232 233 |
# File 'lib/commands.rb', line 231 def default_hive_path File.join(get_field(:apps_path), "libs/hive/") end |
#default_pig_cmd ⇒ Object
226 227 228 229 |
# File 'lib/commands.rb', line 226 def default_pig_cmd [ File.join(get_field(:pig_path), "pig-script"), "--base-path", get_field(:pig_path) ] end |
#default_pig_path ⇒ Object
222 223 224 |
# File 'lib/commands.rb', line 222 def default_pig_path File.join(get_field(:apps_path), "libs/pig/") end |
#default_resize_jobflow_cmd ⇒ Object
240 241 242 |
# File 'lib/commands.rb', line 240 def default_resize_jobflow_cmd File.join(get_field(:apps_path), "libs/resize-job-flow/0.1/resize-job-flow.jar") end |
#default_script_runner_path ⇒ Object
218 219 220 |
# File 'lib/commands.rb', line 218 def default_script_runner_path File.join(get_field(:apps_path), "libs/script-runner/script-runner.jar") end |
#ensure_install_cmd(jobflow, sc, install_step_class) ⇒ Object
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/commands.rb', line 269 def ensure_install_cmd(jobflow, sc, install_step_class) has_install = false install_step = install_step_class.new_from_commands(commands, self) if install_step.jobflow_has_install_step(jobflow) then return sc else new_sc = [] has_install_pi = false for sc_cmd in sc do if sc_cmd.is_a?(install_step_class) then if has_install_pi then next else has_install_pi = true end end if sc_cmd.is_a?(self.class) then if ! has_install_pi then has_install_pi = true new_sc << install_step install_step.validate end end new_sc << sc_cmd end end return new_sc end |
#extra_args ⇒ Object
261 262 263 264 265 266 267 |
# File 'lib/commands.rb', line 261 def extra_args if @args != nil && @args.size > 0 then return ["--args"] + @args else return [] end end |
#reorder_steps(jobflow, sc) ⇒ Object
298 299 300 |
# File 'lib/commands.rb', line 298 def reorder_steps(jobflow, sc) return sc end |
#script_args ⇒ Object
253 254 255 256 257 258 259 |
# File 'lib/commands.rb', line 253 def script_args if @arg then [ @arg ] + @args else @args end end |
#validate ⇒ Object
248 249 250 251 |
# File 'lib/commands.rb', line 248 def validate super require(:apps_path, "--apps-path path must be defined") end |