YUKI Hiroshi
null+****@clear*****
Wed Jan 29 14:54:34 JST 2014
YUKI Hiroshi 2014-01-29 14:54:34 +0900 (Wed, 29 Jan 2014) New Revision: f72376d5b7c2c8e8c5d286b85527a1e4b57be7eb https://github.com/droonga/fluent-plugin-droonga/commit/f72376d5b7c2c8e8c5d286b85527a1e4b57be7eb Message: Define reducer and gatherer for errors by the framework Modified files: lib/droonga/distributor_plugin.rb lib/droonga/plugin/distributor/crud.rb Modified: lib/droonga/distributor_plugin.rb (+18 -7) =================================================================== --- lib/droonga/distributor_plugin.rb 2014-01-29 16:13:31 +0900 (2b64be9) +++ lib/droonga/distributor_plugin.rb 2014-01-29 14:54:34 +0900 (32d503d) @@ -56,7 +56,7 @@ module Droonga "body" => message["body"], "key" => key, "type" => "scatter", - "outputs" => [], + "outputs" => ["errors"], "replica" => "all", "post" => true } @@ -68,7 +68,7 @@ module Droonga "dataset" => message["dataset"], "body" => message["body"], "type" => "broadcast", - "outputs" => [], + "outputs" => ["errors"], "replica" => "all", "post" => true } @@ -77,17 +77,28 @@ module Droonga def reducer(message) { "type" => "reduce", - "body" => {}, - "inputs" => [], - "outputs" => [], + "body" => { + "errors" => { + "errors_reduced" => { + "type" => "sum", + "limit" => -1, + }, + }, + }, + "inputs" => ["errors"], + "outputs" => ["errors_reduced"], } end def gatherer(message) { "type" => "gather", - "body" => {}, - "inputs" => [], + "body" => { + "errors_reduced" => { + "output" => "errors", + }, + }, + "inputs" => ["errors_reduced"], "post" => true, } end Modified: lib/droonga/plugin/distributor/crud.rb (+0 -13) =================================================================== --- lib/droonga/plugin/distributor/crud.rb 2014-01-29 16:13:31 +0900 (6ba9e19) +++ lib/droonga/plugin/distributor/crud.rb 2014-01-29 14:54:34 +0900 (00b838d) @@ -44,7 +44,6 @@ module Droonga def scatterer(message, key) scatterer = super scatterer["outputs"] << "success" - scatterer["outputs"] << "errors" scatterer end @@ -57,14 +56,6 @@ module Droonga } reducer["inputs"] << "success" reducer["outputs"] << "success_reduced" - reducer["body"]["errors"] = { - "errors_reduced" => { - "type" => "sum", - "limit" => -1, - }, - } - reducer["inputs"] << "errors" - reducer["outputs"] << "errors_reduced" reducer end @@ -74,10 +65,6 @@ module Droonga "output" => "success", } gatherer["inputs"] << "success_reduced" - gatherer["body"]["errors_reduced"] = { - "output" => "errors", - } - gatherer["inputs"] << "errors_reduced" gatherer end end -------------- next part -------------- HTML����������������������������...Télécharger