[Groonga-commit] droonga/droonga-engine at ada4b94 [master] Don't reduce results if the "replyTo" is not given, for now

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Apr 17 15:45:29 JST 2015


YUKI Hiroshi	2015-04-17 15:45:29 +0900 (Fri, 17 Apr 2015)

  New Revision: ada4b9468c7a6a464e9baf641f9431c1682567f3
  https://github.com/droonga/droonga-engine/commit/ada4b9468c7a6a464e9baf641f9431c1682567f3

  Message:
    Don't reduce results if the "replyTo" is not given, for now

  Modified files:
    lib/droonga/planner.rb

  Modified: lib/droonga/planner.rb (+19 -3)
===================================================================
--- lib/droonga/planner.rb    2015-04-15 22:27:27 +0900 (13ac2d0)
+++ lib/droonga/planner.rb    2015-04-17 15:45:29 +0900 (6b7389f)
@@ -35,7 +35,23 @@ module Droonga
       options = {
         :record => params[:record],
       }
-      if @collector_class
+
+      #TODO: We don't have to reduce results of the message when
+      #      the message doesn't have "replyTo" information, because:
+      #
+      #       * Currently the "super step" mecahnism is not
+      #         implemented yet.
+      #       * So, reduced results won't be forwarded to other
+      #         handlers directly. Results will be forwarded to
+      #         the sender as the "response".
+      #       * So, if "replyTo" information is not given, the
+      #         reduced result will have no receiver.
+      #
+      #      However, in the future after the "super step" mechanism
+      #      is introduced, reduced results can be required even if
+      #      the request message have no "replyTo" information.
+      #      Then we must update this logic.
+      if @collector_class and message["replyTo"]
         reduce_key = "result"
         options[:reduce] = {
           reduce_key => @collector_class.operator,
@@ -70,7 +86,7 @@ module Droonga
         scatter_options[:replica] = "random"
       end
       planner.scatter(scatter_options)
-      planner.reduce(options[:reduce])
+      planner.reduce(options[:reduce]) if options[:reduce]
       planner.plan
     end
 
@@ -86,7 +102,7 @@ module Droonga
         broadcast_options[:replica] = "random"
       end
       planner.broadcast(broadcast_options)
-      planner.reduce(options[:reduce])
+      planner.reduce(options[:reduce]) if options[:reduce]
       planner.plan
     end
   end
-------------- next part --------------
HTML����������������������������...
다운로드 



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