[Groonga-commit] droonga/droonga-engine at 562e463 [master] Accept scatter without record

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Apr 14 16:06:27 JST 2015


YUKI Hiroshi	2015-04-14 16:06:27 +0900 (Tue, 14 Apr 2015)

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

  Message:
    Accept scatter without record

  Modified files:
    lib/droonga/distributed_command_planner.rb
    lib/droonga/planner.rb

  Modified: lib/droonga/distributed_command_planner.rb (+2 -2)
===================================================================
--- lib/droonga/distributed_command_planner.rb    2015-04-14 15:56:51 +0900 (570c2f0)
+++ lib/droonga/distributed_command_planner.rb    2015-04-14 16:06:27 +0900 (a4b377f)
@@ -55,12 +55,12 @@ module Droonga
       end
     end
 
-    def scatter(record, options={})
+    def scatter(options={})
       @processor = {
         "command" => @source_message["type"],
         "dataset" => @dataset.name,
         "body"    => options[:body] || @source_message["body"],
-        "record"  => record,
+        "record"  => options[:record],
         "type"    => "scatter",
         "outputs" => [],
         "replica" => options[:replica] || "all",

  Modified: lib/droonga/planner.rb (+5 -4)
===================================================================
--- lib/droonga/planner.rb    2015-04-14 15:56:51 +0900 (2c62d8c)
+++ lib/droonga/planner.rb    2015-04-14 16:06:27 +0900 (5a4cceb)
@@ -35,6 +35,7 @@ module Droonga
       options = {
         :write  => write?,
         :random => random?,
+        :record => params[:record],
       }
       if @collector_class
         reduce_key = "result"
@@ -43,9 +44,8 @@ module Droonga
         }
       end
 
-      record = params[:record]
-      if record
-        scatter(message, record, options)
+      if options[:record]
+        scatter(message, options)
       else
         broadcast(message, options)
       end
@@ -68,9 +68,10 @@ module Droonga
       planner = DistributedCommandPlanner.new(@dataset, message)
       scatter_options = {
         :write => options[:write],
+        :record => options[:record],
       }
       scatter_options[:replica] = "random" if options[:random]
-      planner.scatter(record, scatter_options)
+      planner.scatter(scatter_options)
       planner.reduce(options[:reduce])
       planner.plan
     end
-------------- next part --------------
HTML����������������������������...
Download 



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