YUKI Hiroshi
null+****@clear*****
Mon Feb 3 15:28:31 JST 2014
YUKI Hiroshi 2014-02-03 15:28:31 +0900 (Mon, 03 Feb 2014) New Revision: ef4d47d686456e7deb15229ddddd9d9a8768545c https://github.com/droonga/fluent-plugin-droonga/commit/ef4d47d686456e7deb15229ddddd9d9a8768545c Message: Make body optional Modified files: lib/droonga/distributed_command_planner.rb lib/droonga/distributor_plugin.rb lib/droonga/plugin/distributor/distributed_search_planner.rb Modified: lib/droonga/distributed_command_planner.rb (+4 -4) =================================================================== --- lib/droonga/distributed_command_planner.rb 2014-02-06 16:28:16 +0900 (dcc811a) +++ lib/droonga/distributed_command_planner.rb 2014-02-03 15:28:31 +0900 (a7b8dd5) @@ -55,11 +55,11 @@ module Droonga end end - def scatter(body=nil) + def scatter(options={}) @processor = { "command" => @source_message["type"], "dataset" => @dataset || @source_message["dataset"], - "body" => body || @source_message["body"], + "body" => options[:body] || @source_message["body"], "key" => nil, "type" => "scatter", "outputs" => [], @@ -68,11 +68,11 @@ module Droonga } end - def broadcast(body=nil, options={}) + def broadcast(options={}) processor = { "command" => @source_message["type"], "dataset" => @dataset || @source_message["dataset"], - "body" => body || @source_message["body"], + "body" => options[:body] || @source_message["body"], "type" => "broadcast", "outputs" => [], "replica" => "random" Modified: lib/droonga/distributor_plugin.rb (+2 -2) =================================================================== --- lib/droonga/distributor_plugin.rb 2014-02-06 16:28:16 +0900 (ef1bf67) +++ lib/droonga/distributor_plugin.rb 2014-02-03 15:28:31 +0900 (de0b8e4) @@ -33,7 +33,7 @@ module Droonga def scatter(message, options={}) planner = DistributedCommandPlanner.new(message) - planner.scatter(nil) + planner.scatter planner.key = options[:key] planner.reduce(options[:reduce]) distribute(planner.plan) @@ -41,7 +41,7 @@ module Droonga def broadcast(message, options={}) planner = DistributedCommandPlanner.new(message) - planner.broadcast(nil, :write => options[:write]) + planner.broadcast(:write => options[:write]) planner.reduce(options[:reduce]) distribute(planner.plan) end Modified: lib/droonga/plugin/distributor/distributed_search_planner.rb (+1 -1) =================================================================== --- lib/droonga/plugin/distributor/distributed_search_planner.rb 2014-02-06 16:28:16 +0900 (7f7c1e1) +++ lib/droonga/plugin/distributor/distributed_search_planner.rb 2014-02-03 15:28:31 +0900 (cc1a6c2) @@ -37,7 +37,7 @@ module Droonga end @dataset = @source_message["dataset"] || @request["dataset"] - broadcast(@request) + broadcast(:body => @request) super end -------------- next part -------------- HTML����������������������������... Download