YUKI Hiroshi
null+****@clear*****
Wed Jan 29 20:32:56 JST 2014
YUKI Hiroshi 2014-01-29 20:32:56 +0900 (Wed, 29 Jan 2014) New Revision: 60b1b7376e44be7f542f3a2cc74117549c73ce29 https://github.com/droonga/fluent-plugin-droonga/commit/60b1b7376e44be7f542f3a2cc74117549c73ce29 Message: Reduce and gather errors by the search collector Modified files: lib/droonga/plugin/collector/search.rb lib/droonga/plugin/distributor/distributed_search_planner.rb Modified: lib/droonga/plugin/collector/search.rb (+4 -0) =================================================================== --- lib/droonga/plugin/collector/search.rb 2014-01-29 19:45:50 +0900 (7298963) +++ lib/droonga/plugin/collector/search.rb 2014-01-29 20:32:56 +0900 (38e7a9a) @@ -84,6 +84,10 @@ module Droonga command :collector_search_reduce def collector_search_reduce(request) + if input_name == "errors" + return collector_reduce(request) + end + return unless request body[input_name].each do |output, elements| value = request Modified: lib/droonga/plugin/distributor/distributed_search_planner.rb (+8 -6) =================================================================== --- lib/droonga/plugin/distributor/distributed_search_planner.rb 2014-01-29 19:45:50 +0900 (b948ca5) +++ lib/droonga/plugin/distributor/distributed_search_planner.rb 2014-01-29 20:32:56 +0900 (70450ba) @@ -71,12 +71,14 @@ module Droonga transformer = QueryTransformer.new(query) - @reducers << reducer_message("search_reduce", - input_name, - transformer.reducers) - @gatherers << gatherer_message("search_gather", - input_name, - "elements" => transformer.mappers) + reduce(input_name, + transformer.reducers, + "elements" => transformer.mappers) + end + + def reduce(name, reducer, gatherer={}) + @reducers << reducer_message("search_reduce", name, reducer) + @gatherers << gatherer_message("search_gather", name, gatherer) end class QueryTransformer -------------- next part -------------- HTML����������������������������... Download