Class: Commands::EnableDebuggingCommand

Inherits:
StepCommand show all
Defined in:
lib/commands.rb

Instance Attribute Summary

Attributes inherited from StepCommand

#apps_path, #args, #beta_path, #enable_debugging_path, #hive_cmd, #hive_path, #pig_cmd, #pig_path, #script_runner_path, #step_action, #step_name

Attributes inherited from Command

#arg, #commands, #description, #logger, #name

Instance Method Summary collapse

Methods inherited from StepCommand

#default_enable_debugging_path, #default_hive_cmd, #default_hive_path, #default_pig_cmd, #default_pig_path, #default_resize_jobflow_cmd, #default_script_runner_path, #ensure_install_cmd, #extra_args, #initialize, #script_args, #validate

Methods inherited from Command

#enact, #get_field, #has_value, #have, #initialize, #option, #require, #require_single_jobflow, #resolve, #validate

Constructor Details

This class inherits a constructor from Commands::StepCommand

Instance Method Details

#reorder_steps(jobflow, sc) ⇒ Object



335
336
337
338
339
340
341
342
343
344
# File 'lib/commands.rb', line 335

def reorder_steps(jobflow, sc)
  # remove enable debugging steps and add self at start
  new_sc = []
  for step_cmd in sc do
    if ! step_cmd.is_a?(EnableDebuggingCommand) then
      new_sc << step_cmd
    end
  end
  return [ self ] + new_sc
end

#stepsObject



323
324
325
326
327
328
329
330
331
332
333
# File 'lib/commands.rb', line 323

def steps
  step = {
    "Name"            => get_field(:step_name, "Setup Hadoop Debugging"),
    "ActionOnFailure" => get_field(:step_action, "TERMINATE_JOB_FLOW"),
    "HadoopJarStep"   => {
      "Jar" => get_field(:script_runner_path),
      "Args" => [ File.join(get_field(:enable_debugging_path), "fetch") ]
    }
  }
  return [ step ]
end