[Groonga-commit] droonga/fluent-plugin-droonga at b74bfd0 [master] Boardcast Groonga messages with DistributedCommandPlanner

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Jan 29 17:52:56 JST 2014


YUKI Hiroshi	2014-01-29 17:52:56 +0900 (Wed, 29 Jan 2014)

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

  Message:
    Boardcast Groonga messages with DistributedCommandPlanner

  Modified files:
    lib/droonga/plugin/distributor/groonga.rb

  Modified: lib/droonga/plugin/distributor/groonga.rb (+6 -27)
===================================================================
--- lib/droonga/plugin/distributor/groonga.rb    2014-01-29 17:52:47 +0900 (f9b84ce)
+++ lib/droonga/plugin/distributor/groonga.rb    2014-01-29 17:52:56 +0900 (c91f833)
@@ -43,33 +43,12 @@ module Droonga
     end
 
     private
-    def broadcaster(message)
-      broadcaster = super
-      broadcaster["outputs"] << "result"
-      broadcaster
-    end
-
-    def reducer(message)
-      reducer = super
-      reducer["type"] = "groonga_reduce"
-      reducer["body"]["result"] = {
-        "result_reduced" => {
-          "type" => "groonga_result",
-        },
-      }
-      reducer["inputs"] << "result"
-      reducer["outputs"] << "result_reduced"
-      reducer
-    end
-
-    def gatherer(message)
-      gatherer = super
-      gatherer["type"] = "groonga_gather"
-      gatherer["body"]["result_reduced"] = {
-        "output" => "result",
-      }
-      gatherer["inputs"] << "result_reduced"
-      gatherer
+    def broadcast_all(message)
+      planner = DistributedCommandPlanner.new(message)
+      planner.outputs << "result"
+      planner.reduce("result", "type" => "or")
+      planner.broadcast_all
+      distribute(planner.messages)
     end
   end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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