Class: HadoopDsl::BaseReducer

Inherits:
BaseMapRed show all
Defined in:
lib/core.rb

Instance Attribute Summary

Attributes inherited from BaseMapRed

#emitted

Instance Method Summary collapse

Methods inherited from BaseMapRed

#emit, #initialize

Methods included from DslController

#pre_process, #run

Methods included from DslElement

#method_missing

Constructor Details

This class inherits a constructor from HadoopDsl::BaseMapRed

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class HadoopDsl::DslElement

Instance Method Details

#aggregateObject

common functions



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

def aggregate
  emit(@model.key => @model.values.inject {|ret, i| ret + i})
end

#identityObject



77
78
79
# File 'lib/core.rb', line 77

def identity
  @model.values.each {|v| emit(@model.key => v)}
end