Class: Rubadoop::MapReduce::CallStreaming
- Defined in:
- lib/rubadoop/map_reduce/call_streaming.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#combiner ⇒ Object
Returns the value of attribute combiner.
-
#input ⇒ Object
Returns the value of attribute input.
-
#inputformat ⇒ Object
Returns the value of attribute inputformat.
-
#mapper ⇒ Object
Returns the value of attribute mapper.
-
#output ⇒ Object
Returns the value of attribute output.
-
#outputformat ⇒ Object
Returns the value of attribute outputformat.
-
#reducer ⇒ Object
Returns the value of attribute reducer.
Attributes inherited from CallJava
#archives, #args, #confs, #envs, #files, #jar, #main_class
Attributes inherited from BaseDsl
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ CallStreaming
constructor
A new instance of CallStreaming.
- #to_h ⇒ Object
- #to_hadoop_cli(opts = {}) ⇒ Object
- #validate ⇒ Object
Methods inherited from CallJava
#archive, #arg, #conf, #conf_concat, #env, #file, new_java_call
Methods inherited from BaseDsl
Constructor Details
#initialize(params = {}) ⇒ CallStreaming
Returns a new instance of CallStreaming.
20 21 22 |
# File 'lib/rubadoop/map_reduce/call_streaming.rb', line 20 def initialize(params = {}) super(params) end |
Instance Attribute Details
#combiner ⇒ Object
Returns the value of attribute combiner.
4 5 6 |
# File 'lib/rubadoop/map_reduce/call_streaming.rb', line 4 def combiner @combiner end |
#input ⇒ Object
Returns the value of attribute input.
4 5 6 |
# File 'lib/rubadoop/map_reduce/call_streaming.rb', line 4 def input @input end |
#inputformat ⇒ Object
Returns the value of attribute inputformat.
4 5 6 |
# File 'lib/rubadoop/map_reduce/call_streaming.rb', line 4 def inputformat @inputformat end |
#mapper ⇒ Object
Returns the value of attribute mapper.
4 5 6 |
# File 'lib/rubadoop/map_reduce/call_streaming.rb', line 4 def mapper @mapper end |
#output ⇒ Object
Returns the value of attribute output.
4 5 6 |
# File 'lib/rubadoop/map_reduce/call_streaming.rb', line 4 def output @output end |
#outputformat ⇒ Object
Returns the value of attribute outputformat.
4 5 6 |
# File 'lib/rubadoop/map_reduce/call_streaming.rb', line 4 def outputformat @outputformat end |
#reducer ⇒ Object
Returns the value of attribute reducer.
4 5 6 |
# File 'lib/rubadoop/map_reduce/call_streaming.rb', line 4 def reducer @reducer end |
Class Method Details
.new_streaming_call(params = {}, &block) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/rubadoop/map_reduce/call_streaming.rb', line 7 def new_streaming_call(params = {}, &block) builder = CallStreaming.new(params) if block_given? if block.arity == 1 yield builder else builder.instance_eval &block end end builder end |
Instance Method Details
#to_h ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/rubadoop/map_reduce/call_streaming.rb', line 37 def to_h built = super [:@mapper, :@reducer, :@combiner, :@inputformat, :@input, :@outputformat, :@output].each { |entry| value = instance_variable_get(entry) built[entry.to_s.delete("@").to_sym] = value unless value.nil? } built end |
#to_hadoop_cli(opts = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rubadoop/map_reduce/call_streaming.rb', line 24 def to_hadoop_cli(opts = {}) cmd = super(opts.merge(skip_args: true)) cmd.concat ['-inputformat', "#{@inputformat}"] if @inputformat cmd.concat ['-input', "#{@input}"] if @input cmd.concat ['-outputformat', "#{@outputformat}"] if @outputformat cmd.concat ['-output', "#{@output}"] if @output cmd.concat ['-mapper', "#{@mapper}"] if @mapper cmd.concat ['-reducer', "#{@reducer}"] if @reducer cmd.concat ['-combiner', "#{@combiner}"] if @combiner cmd.concat @args if @args cmd end |
#validate ⇒ Object
46 47 48 49 50 51 |
# File 'lib/rubadoop/map_reduce/call_streaming.rb', line 46 def validate super [:@mapper, :@reducer, :@input, :@output].each { |property| raise "Missing #{property}" if instance_variable_get(property).nil? } end |