Class: ReduceContext

Inherits:
Object
  • Object
show all
Defined in:
lib/learn_mapreduce.rb

Overview

The context within the reducer Used to give a custom ‘emit’ function

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeReduceContext

Returns a new instance of ReduceContext.



90
91
92
# File 'lib/learn_mapreduce.rb', line 90

def initialize
   @output = []
end

Instance Attribute Details

#outputObject

Returns the value of attribute output.



88
89
90
# File 'lib/learn_mapreduce.rb', line 88

def output
  @output
end

Instance Method Details

#emit(value) ⇒ Object



94
95
96
# File 'lib/learn_mapreduce.rb', line 94

def emit value
   @output.push(value)
end