[Groonga-commit] droonga/droonga-engine at d9f33a0 [master] Make "write" parameter optional for "scatter" also

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Apr 14 15:20:59 JST 2015


YUKI Hiroshi	2015-04-14 15:20:59 +0900 (Tue, 14 Apr 2015)

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

  Message:
    Make "write" parameter optional for "scatter" also

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

  Modified: lib/droonga/distributed_command_planner.rb (+3 -6)
===================================================================
--- lib/droonga/distributed_command_planner.rb    2015-04-14 15:08:55 +0900 (db24535)
+++ lib/droonga/distributed_command_planner.rb    2015-04-14 15:20:59 +0900 (6c557ed)
@@ -64,23 +64,20 @@ module Droonga
         "type"    => "scatter",
         "outputs" => [],
         "replica" => options[:replica] || "all",
-        "post"    => true
+        "post"    => options[:write] || false,
       }
     end
 
     def broadcast(options={})
-      processor = {
+      @processor = {
         "command" => @source_message["type"],
         "dataset" => @dataset.name,
         "body"    => options[:body] || @source_message["body"],
         "type"    => "broadcast",
         "outputs" => [],
         "replica" => options[:replica] || "random"
+        "post"    => options[:write] || false,
       }
-      if options[:write]
-        processor["post"] = true
-      end
-      @processor = processor
     end
 
     private

  Modified: lib/droonga/planner.rb (+4 -1)
===================================================================
--- lib/droonga/planner.rb    2015-04-14 15:08:55 +0900 (cb4b1d9)
+++ lib/droonga/planner.rb    2015-04-14 15:20:59 +0900 (41b4d39)
@@ -33,7 +33,10 @@ module Droonga
     private
     def scatter(message, record, options={})
       planner = DistributedCommandPlanner.new(@dataset, message)
-      planner.scatter(record)
+      scatter_options = {
+        :write => options[:write],
+      }
+      planner.scatter(record, 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