Class: Droonga::StepRunner
- Inherits:
-
Object
- Object
- Droonga::StepRunner
- Includes:
- Loggable
- Defined in:
- lib/droonga/step_runner.rb
Instance Method Summary collapse
- #find(type) ⇒ Object
-
#initialize(dataset, plugins) ⇒ StepRunner
constructor
A new instance of StepRunner.
- #plan(message) ⇒ Object
- #shutdown ⇒ Object
Constructor Details
#initialize(dataset, plugins) ⇒ StepRunner
Returns a new instance of StepRunner.
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/droonga/step_runner.rb', line 24 def initialize(dataset, plugins) @dataset = dataset @definitions = {} plugins.each do |name| plugin = Plugin.registry[name] plugin.single_step_definitions.each do |definition| @definitions[definition.name] = definition end end end |
Instance Method Details
#find(type) ⇒ Object
55 56 57 |
# File 'lib/droonga/step_runner.rb', line 55 def find(type) @definitions[type] end |
#plan(message) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/droonga/step_runner.rb', line 38 def plan() type = ["type"] logger.trace("plan: start", :dataset => ["dataset"], :type => type) definition = find(type) if definition.nil? raise UnsupportedMessageError.new(:planner, ) end step = SingleStep.new(@dataset, definition) plan = step.plan() logger.trace("plan: done", :dataset => ["dataset"], :type => type) plan end |
#shutdown ⇒ Object
35 36 |
# File 'lib/droonga/step_runner.rb', line 35 def shutdown end |