Class: BatchSpout

Inherits:
Object
  • Object
show all
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

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

#closeObject



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

#getComponentConfigurationObject



55
56
57
# File 'lib/red_storm/proxy/batch_spout.rb', line 55

def getComponentConfiguration
  @real_spout.get_component_configuration
end

#getOutputFieldsObject



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