Class: Swineherd::Script::WukongScript
- Inherits:
-
Object
- Object
- Swineherd::Script::WukongScript
- Includes:
- Common
- Defined in:
- lib/swineherd/script/wukong_script.rb
Instance Attribute Summary
Attributes included from Common
#attributes, #input, #options, #output
Instance Method Summary collapse
- #cmd ⇒ Object
- #local_cmd ⇒ Object
-
#script ⇒ Object
Don’t treat wukong scripts as templates.
- #wukong_args(options) ⇒ Object
Methods included from Common
#env, #initialize, #refresh!, #run
Instance Method Details
#cmd ⇒ Object
18 19 20 21 22 |
# File 'lib/swineherd/script/wukong_script.rb', line 18 def cmd raise "No wukong input specified" if input.empty? Log.info("Launching Wukong script in hadoop mode") "ruby #{script} #{wukong_args(@options)} --run #{input.join(',')} #{output.join(',')}" end |
#local_cmd ⇒ Object
24 25 26 27 28 |
# File 'lib/swineherd/script/wukong_script.rb', line 24 def local_cmd inputs = input.map{|path| path += File.directory?(path) ? "/*" : ""}.join(',') Log.info("Launching Wukong script in local mode") "ruby #{script} #{wukong_args(@options)} --run=local #{inputs} #{output.join(',')}" end |
#script ⇒ Object
Don’t treat wukong scripts as templates
14 15 16 |
# File 'lib/swineherd/script/wukong_script.rb', line 14 def script @source end |
#wukong_args(options) ⇒ Object
7 8 9 |
# File 'lib/swineherd/script/wukong_script.rb', line 7 def wukong_args .map{|param,val| "--#{param}=#{val}" }.join(' ') end |