Class: Hadupils::Commands::Hadoop

Inherits:
SimpleCommand show all
Includes:
HadoopExt, UserConf
Defined in:
lib/hadupils/commands.rb

Instance Attribute Summary

Attributes inherited from SimpleCommand

#params

Instance Method Summary collapse

Methods included from UserConf

#user_config

Methods included from HadoopExt

#hadoop_ext

Methods inherited from SimpleCommand

#initialize, run, #successful?

Constructor Details

This class inherits a constructor from Hadupils::Commands::SimpleCommand

Instance Method Details

#assemble_parameters(parameters) ⇒ Object



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/hadupils/commands.rb', line 60

def assemble_parameters(parameters)
  @hadoop_ext     = Hadupils::Extensions::Static.new(Hadupils::Search.hadoop_assets)
  hadoop_cmd      = parameters[0...1]
  hadoop_cmd_opts = parameters[1..-1] || []

  if %w(fs dfs).include? parameters[0]
    hadoop_cmd + user_config.hadoop_confs + hadoop_ext.hadoop_confs + hadoop_cmd_opts
  else
    # TODO: Assemble command line parameters to pkg assets/code for submitting jobs, for i.e.
    hadoop_cmd + user_config.hadoop_confs + hadoop_ext.hadoop_confs + hadoop_cmd_opts
  end
end

#runObject



73
74
75
# File 'lib/hadupils/commands.rb', line 73

def run
  Hadupils::Runners::Hadoop.run assemble_parameters(params)
end