Class: RedStorm::DSL::InputBoltDefinition

Inherits:
Topology::BoltDefinition show all
Defined in:
lib/red_storm/dsl/drpc_topology.rb

Instance Attribute Summary collapse

Attributes inherited from Topology::BoltDefinition

#command, #sources

Attributes inherited from Topology::ComponentDefinition

#clazz, #constructor_args, #id, #parallelism

Attributes inherited from Configurator

#config

Instance Method Summary collapse

Methods inherited from Topology::BoltDefinition

#new_instance, #source

Methods inherited from Topology::ComponentDefinition

#is_java?, #output_fields

Methods inherited from Configurator

#method_missing, #set

Constructor Details

#initialize(*args) ⇒ InputBoltDefinition

Returns a new instance of InputBoltDefinition.



11
12
13
14
# File 'lib/red_storm/dsl/drpc_topology.rb', line 11

def initialize(*args)
  super
  @grouping = :none
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RedStorm::Configurator

Instance Attribute Details

#grouping(grouping) ⇒ Object

Returns the value of attribute grouping.



9
10
11
# File 'lib/red_storm/dsl/drpc_topology.rb', line 9

def grouping
  @grouping
end

Instance Method Details

#define_grouping(declarer) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/red_storm/dsl/drpc_topology.rb', line 20

def define_grouping(declarer)
  case @grouping
  when :fields
    declarer.fieldsGrouping(Fields.new(*([params].flatten.map(&:to_s))))
  when :global
    declarer.globalGrouping()
  when :shuffle
    declarer.shuffleGrouping()
  when :local_or_shuffle
    declarer.localOrShuffleGrouping()
  when :none
    declarer.noneGrouping()
  when :all
    declarer.allGrouping()
  when :direct
    declarer.directGrouping()
  else
    raise("unknown grouper=#{grouper.inspect}")
  end
end