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.



65
66
67
# File 'lib/learn_mapreduce.rb', line 65

def initialize
   @output = []
end

Instance Attribute Details

#outputObject

Returns the value of attribute output.



63
64
65
# File 'lib/learn_mapreduce.rb', line 63

def output
  @output
end

Instance Method Details

#emit(value) ⇒ Object



69
70
71
# File 'lib/learn_mapreduce.rb', line 69

def emit value
   @output.push(value)
end