Class: Clusta::Transforms::Pm3d::Reducer

Inherits:
Wukong::Streamer::AccumulatingReducer
  • Object
show all
Defined in:
lib/clusta/transforms/pm3d.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#recordsObject

Returns the value of attribute records.



20
21
22
# File 'lib/clusta/transforms/pm3d.rb', line 20

def records
  @records
end

Instance Method Details

#accumulate(*record) ⇒ Object



26
27
28
# File 'lib/clusta/transforms/pm3d.rb', line 26

def accumulate *record
  self.records << record
end

#finalize(&block) ⇒ Object



30
31
32
33
# File 'lib/clusta/transforms/pm3d.rb', line 30

def finalize &block
  records.each { |record| emit(record) }
  emit []
end

#start!(*record) ⇒ Object



22
23
24
# File 'lib/clusta/transforms/pm3d.rb', line 22

def start! *record
  self.records = []
end