Class: Pmux::Reducer

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

Direct Known Subclasses

StreamingReducer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task, tmp_dir, loop = nil) ⇒ Reducer

Returns a new instance of Reducer.

Raises:

  • (RuntimeError)


6
7
8
9
10
11
12
13
14
15
16
# File 'lib/pmux/reducer.rb', line 6

def initialize task, tmp_dir, loop=nil
  @task = task
  @tmp_dir = tmp_dir
  @loop = loop
  @paths = Dir.glob("#{tmp_dir}/t*-#{task['pindex']}")
  @output_path = nil
  @on_receive = nil
  @on_success = nil
  @on_error = nil
  raise RuntimeError, 'no input files' if @paths.empty?
end

Instance Attribute Details

#exitstatusObject (readonly)

Returns the value of attribute exitstatus.



3
4
5
# File 'lib/pmux/reducer.rb', line 3

def exitstatus
  @exitstatus
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



3
4
5
# File 'lib/pmux/reducer.rb', line 3

def output_path
  @output_path
end

#tmp_dirObject

Returns the value of attribute tmp_dir.



4
5
6
# File 'lib/pmux/reducer.rb', line 4

def tmp_dir
  @tmp_dir
end

Instance Method Details

#do_reduce_taskObject



18
# File 'lib/pmux/reducer.rb', line 18

def do_reduce_task; end