Class: Fairy::CSegShuffle
- Defined in:
- lib/fairy/master/c-seg-shuffle.rb
Defined Under Namespace
Classes: PortQueue
Instance Attribute Summary
Attributes inherited from CIOFilter
Attributes included from CInputtable
Instance Method Summary collapse
- #each_assigned_filter(&block) ⇒ Object
-
#initialize(controller, opts, block_source) ⇒ CSegShuffle
constructor
include BInputtable.
- #njob_creation_params ⇒ Object
- #node_class_name ⇒ Object
Methods inherited from CIOFilter
Methods included from CInputtable
Methods inherited from CFilter
#abort_create_node, #add_node, #assgin_number_of_nodes?, #bind_export, #break_create_node, #break_running, #create_and_add_node, #create_import, #create_node, #create_nodes, #def_job_pool_variable, #each_export_by, #each_node, #each_node_exist_only, #handle_exception, #input, #job_pool_dict, #job_pool_variable, #nodes, #number_of_nodes, #number_of_nodes=, #pool_dict, #postmapping_policy, #start_create_nodes, #start_export, #start_watch_node_status, #update_status, watch_status, watch_status=, #watch_status?
Constructor Details
#initialize(controller, opts, block_source) ⇒ CSegShuffle
include BInputtable
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/fairy/master/c-seg-shuffle.rb', line 16 def initialize(controller, opts, block_source) super # @block = @context.create_proc(@block_source.source) @node2input = {} @input2node = {} @input_queue = PortQueue.new @output_queue = PortQueue.new @block_source = block_source @begin_block_source = nil if @opts[:BEGIN] @begin_block_source = @opts[:BEGIN] end @end_block_source = nil if @opts[:END] @end_block_source = @opts[:END] end end |
Instance Method Details
#each_assigned_filter(&block) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/fairy/master/c-seg-shuffle.rb', line 45 def each_assigned_filter(&block) each_node do |node| @input_queue.push node end @input_queue.push nil if @begin_block_source bsource = BScript.new(@begin_block_source, @context, self) bsource.evaluate end @block = BBlock.new(@block_source, @context, self) begin @block.call(@input_queue, @output_queue) @output_queue.push nil ensure if @end_block_source bsource = BSource.new(@end_block_source, @context, self) bsource.evaluate end end no = 0 @output_queue.each do |node| node.no = no no += 1 block.call node end end |
#njob_creation_params ⇒ Object
41 42 43 |
# File 'lib/fairy/master/c-seg-shuffle.rb', line 41 def njob_creation_params [] end |
#node_class_name ⇒ Object
37 38 39 |
# File 'lib/fairy/master/c-seg-shuffle.rb', line 37 def node_class_name "PIdentity" end |