[Groonga-commit] droonga/fluent-plugin-droonga at d7de55f [master] Rename DistributionPlanner to Distributor.

Back to archive index

Daijiro MORI null+****@clear*****
Fri Feb 7 13:59:19 JST 2014


Daijiro MORI	2014-02-07 13:59:19 +0900 (Fri, 07 Feb 2014)

  New Revision: d7de55f24d699a171f79985074f9b1ccff5dd5eb
  https://github.com/droonga/fluent-plugin-droonga/commit/d7de55f24d699a171f79985074f9b1ccff5dd5eb

  Message:
    Rename DistributionPlanner to Distributor.

  Modified files:
    lib/droonga/dispatcher.rb
  Renamed files:
    lib/droonga/distributor.rb
      (from lib/droonga/distribution_planner.rb)

  Modified: lib/droonga/dispatcher.rb (+3 -3)
===================================================================
--- lib/droonga/dispatcher.rb    2014-02-07 13:36:34 +0900 (5fdcaf3)
+++ lib/droonga/dispatcher.rb    2014-02-07 13:59:19 +0900 (de1529c)
@@ -25,7 +25,7 @@ require "droonga/session"
 require "droonga/replier"
 require "droonga/message_processing_error"
 require "droonga/catalog_observer"
-require "droonga/distribution_planner"
+require "droonga/distributor"
 
 module Droonga
   class Dispatcher
@@ -214,8 +214,8 @@ module Droonga
     def process_input_message(message)
       adapted_message = @adapter_runner.adapt_input(message)
       plan =****@plann*****(adapted_message["type"], adapted_message)
-      distributor = DistributionPlanner.new(self, plan)
-      distributor.distribute
+      distributor = Distributor.new(self)
+      distributor.distribute(plan)
     rescue Droonga::Pluggable::UnknownPlugin => error
       raise UnknownCommand.new(error.command, message["dataset"])
     end

  Renamed: lib/droonga/distributor.rb (+5 -11) 88%
===================================================================
--- lib/droonga/distribution_planner.rb    2014-02-07 13:36:34 +0900 (430d488)
+++ lib/droonga/distributor.rb    2014-02-07 13:59:19 +0900 (56ad356)
@@ -18,7 +18,7 @@
 require "tsort"
 
 module Droonga
-  class DistributionPlanner
+  class Distributor
     class UndefinedInputError < StandardError
       attr_reader :input
       def initialize(input)
@@ -37,19 +37,13 @@ module Droonga
 
     include TSort
 
-    def initialize(dispatcher, steps)
+    def initialize(dispatcher)
       @dispatcher = dispatcher
-      @steps = steps
     end
 
-    def distribute
-      planned_steps = plan
-      @dispatcher.dispatch_steps(planned_steps)
-    end
-
-    def plan
+    def distribute(plan)
       @dependency = {}
-      @steps.each do |step|
+      plan.each do |step|
         @dependency[step] = step["inputs"]
         next unless step["outputs"]
         step["outputs"].each do |output|
@@ -61,7 +55,7 @@ module Droonga
         raise CyclicStepsError.new(cs) if cs.size > 1
         steps.concat(cs) unless cs.first.is_a? String
       end
-      steps
+      @dispatcher.dispatch_steps(steps)
     end
 
     private
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index