Class: BatchSpout
- Inherits:
-
Object
- Object
- BatchSpout
- Defined in:
- lib/red_storm/proxy/batch_spout.rb
Overview
the Spout class is a proxy to the real spout to avoid having to deal with all the Java artifacts when creating a spout.
Instance Method Summary collapse
- #ack(batch_id) ⇒ Object
- #close ⇒ Object
- #emitBatch(batch_id, collector) ⇒ Object
- #getComponentConfiguration ⇒ Object
- #getOutputFields ⇒ Object
-
#initialize(base_class_path, real_spout_class_name) ⇒ BatchSpout
constructor
A new instance of BatchSpout.
- #open(conf, context) ⇒ Object
Constructor Details
#initialize(base_class_path, real_spout_class_name) ⇒ BatchSpout
Returns a new instance of BatchSpout.
22 23 24 25 26 27 |
# File 'lib/red_storm/proxy/batch_spout.rb', line 22 def initialize(base_class_path, real_spout_class_name) @real_spout = Object.module_eval(real_spout_class_name).new rescue NameError require base_class_path @real_spout = Object.module_eval(real_spout_class_name).new end |
Instance Method Details
#ack(batch_id) ⇒ Object
45 46 47 |
# File 'lib/red_storm/proxy/batch_spout.rb', line 45 def ack(batch_id) @real_spout.ack(batch_id) if @real_spout.respond_to?(:ack) end |
#close ⇒ Object
40 41 42 |
# File 'lib/red_storm/proxy/batch_spout.rb', line 40 def close @real_spout.close if @real_spout.respond_to?(:close) end |
#emitBatch(batch_id, collector) ⇒ Object
35 36 37 |
# File 'lib/red_storm/proxy/batch_spout.rb', line 35 def emitBatch(batch_id, collector) @real_spout.emit_batch(batch_id, collector) end |
#getComponentConfiguration ⇒ Object
55 56 57 |
# File 'lib/red_storm/proxy/batch_spout.rb', line 55 def getComponentConfiguration @real_spout.get_component_configuration end |
#getOutputFields ⇒ Object
50 51 52 |
# File 'lib/red_storm/proxy/batch_spout.rb', line 50 def getOutputFields() @real_spout.get_output_fields end |
#open(conf, context) ⇒ Object
30 31 32 |
# File 'lib/red_storm/proxy/batch_spout.rb', line 30 def open(conf, context) @real_spout.open(conf, context) if @real_spout.respond_to?(:open) end |