[Groonga-commit] droonga/fluent-plugin-droonga at c698154 [master] Distribute from outside of Planner.

Back to archive index

Daijiro MORI null+****@clear*****
Fri Feb 7 12:26:55 JST 2014


Daijiro MORI	2014-02-07 12:26:55 +0900 (Fri, 07 Feb 2014)

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

  Message:
    Distribute from outside of Planner.

  Modified files:
    lib/droonga/dispatcher.rb
    lib/droonga/planner_plugin.rb
    lib/droonga/pluggable.rb
    lib/droonga/plugin/planner/search.rb
    test/unit/plugin/planner/test_search.rb

  Modified: lib/droonga/dispatcher.rb (+2 -1)
===================================================================
--- lib/droonga/dispatcher.rb    2014-02-07 11:45:33 +0900 (c078d8d)
+++ lib/droonga/dispatcher.rb    2014-02-07 12:26:55 +0900 (c962f7c)
@@ -212,7 +212,8 @@ module Droonga
 
     def process_input_message(message)
       adapted_message = @adapter_runner.adapt_input(message)
-      @planner.process(adapted_message["type"], adapted_message)
+      plan =****@plann*****(adapted_message["type"], adapted_message)
+      @planner.distribute(plan)
     rescue Droonga::Pluggable::UnknownPlugin => error
       raise UnknownCommand.new(error.command, message["dataset"])
     end

  Modified: lib/droonga/planner_plugin.rb (+2 -2)
===================================================================
--- lib/droonga/planner_plugin.rb    2014-02-07 11:45:33 +0900 (9a22a56)
+++ lib/droonga/planner_plugin.rb    2014-02-07 12:26:55 +0900 (e0d6f46)
@@ -36,14 +36,14 @@ module Droonga
       planner.scatter
       planner.key = options[:key]
       planner.reduce(options[:reduce])
-      distribute(planner.plan)
+      planner.plan
     end
 
     def broadcast(message, options={})
       planner = DistributedCommandPlanner.new(message)
       planner.broadcast(:write => options[:write])
       planner.reduce(options[:reduce])
-      distribute(planner.plan)
+      planner.plan
     end
 
     private

  Modified: lib/droonga/pluggable.rb (+2 -1)
===================================================================
--- lib/droonga/pluggable.rb    2014-02-07 11:45:33 +0900 (1f7ed13)
+++ lib/droonga/pluggable.rb    2014-02-07 12:26:55 +0900 (1336699)
@@ -42,9 +42,10 @@ module Droonga
       $log.trace("#{log_tag}: process: start: <#{command}>",
                  :plugin => plugin.class)
       raise UnknownPlugin.new(command) if plugin.nil?
-      plugin.process(command, *arguments)
+      result = plugin.process(command, *arguments)
       $log.trace("#{log_tag}: process: done: <#{command}>",
                  :plugin => plugin.class)
+      result
     end
 
     private

  Modified: lib/droonga/plugin/planner/search.rb (+1 -1)
===================================================================
--- lib/droonga/plugin/planner/search.rb    2014-02-07 11:45:33 +0900 (43b6c7c)
+++ lib/droonga/plugin/planner/search.rb    2014-02-07 12:26:55 +0900 (fba7010)
@@ -25,7 +25,7 @@ module Droonga
     command :search
     def search(message)
       planner = DistributedSearchPlanner.new(message)
-      distribute(planner.plan)
+      planner.plan
     end
   end
 end

  Modified: test/unit/plugin/planner/test_search.rb (+1 -1)
===================================================================
--- test/unit/plugin/planner/test_search.rb    2014-02-07 11:45:33 +0900 (6f2fb67)
+++ test/unit/plugin/planner/test_search.rb    2014-02-07 12:26:55 +0900 (9f0f625)
@@ -56,7 +56,7 @@ class SearchPlannerTest < Test::Unit::TestCase
       },
     }
 
-    @plugin.process("search", envelope)
+    @planner.distribute(@plugin.process("search", envelope))
 
     message = []
 
-------------- next part --------------
HTML����������������������������...
Download 



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