class Commands::PigInteractiveCommand

Public Class Methods

new_from_commands(commands, parent) click to toggle source
# File lib/commands.rb, line 371
def self.new_from_commands(commands, parent)
  sc = self.new("--pig-interactive", "Run a jobflow with Pig Installed", nil, commands)
  sc.step_action = parent.step_action
  return sc
end

Public Instance Methods

jobflow_has_install_step(jobflow) click to toggle source
# File lib/commands.rb, line 389
def jobflow_has_install_step(jobflow)
  install_steps = jobflow['Steps'].select do |step|
  step["ExecutionStatusDetail"]["State"] != "FAILED" &&
    has_value(step, 'StepConfig', 'HadoopJarStep', 'Jar', get_field(:script_runner_path)) &&
    has_value(step, 'StepConfig', 'HadoopJarStep', 'Args', 3, "--install-pig")
  end
  return install_steps.size > 0
end
steps() click to toggle source
# File lib/commands.rb, line 377
def steps
  step = {
    "Name"            => get_field(:step_name, "Setup Pig"),
    "ActionOnFailure" => get_field(:step_action, "TERMINATE_JOB_FLOW"),
    "HadoopJarStep"   => {
      "Jar" => get_field(:script_runner_path),
      "Args" => get_field(:pig_cmd) + ["--install-pig"] + extra_args
    }
  }
  return [ step ]  
end