Class: Tem::Mr::Search::MapReduceJob::Reducer

Inherits:
JobPart
  • Object
show all
Defined in:
lib/tem_mr_search/map_reduce_job.rb

Overview

Wrapper for the reduce SECpack.

Instance Method Summary collapse

Methods inherited from JobPart

#bind, #initialize, #migrate, #to_plain_object

Constructor Details

This class inherits a constructor from Tem::Mr::Search::MapReduceJob::JobPart

Instance Method Details

#reduce_for_outputs(output1, output2) ⇒ Object

SECpack for reducing two inputs coming from maps or other reduces.



125
126
127
128
129
130
131
# File 'lib/tem_mr_search/map_reduce_job.rb', line 125

def reduce_for_outputs(output1, output2)
  new_secpack = Tem::SecPack.new_from_array @secpack.to_array
  
  new_secpack.set_bytes :_output1, output1
  new_secpack.set_bytes :_output2, output2
  new_secpack
end

#reduce_outputs(output1, output2, tem) ⇒ Object

Reduces two inputs coming from maps or other reduces.



134
135
136
137
# File 'lib/tem_mr_search/map_reduce_job.rb', line 134

def reduce_outputs(output1, output2, tem)
  secpack = reduce_for_outputs output1, output2
  tem.execute secpack
end