Kouhei Sutou
null+****@clear*****
Sun Mar 23 17:12:50 JST 2014
Kouhei Sutou 2014-03-23 17:12:50 +0900 (Sun, 23 Mar 2014) New Revision: b4caf0f5852a7103fb91c8184f56c35d1854723f https://github.com/droonga/fluent-plugin-droonga/commit/b4caf0f5852a7103fb91c8184f56c35d1854723f Message: distributor: pass plan to constructor Because one distributor can process only one plan. Modified files: lib/droonga/dispatcher.rb lib/droonga/distributor.rb Modified: lib/droonga/dispatcher.rb (+2 -2) =================================================================== --- lib/droonga/dispatcher.rb 2014-03-23 17:10:18 +0900 (399f875) +++ lib/droonga/dispatcher.rb 2014-03-23 17:12:50 +0900 (9b88c9c) @@ -239,8 +239,8 @@ module Droonga adapted_message = adapter_runner.adapt_input(message) step_runner = @step_runners[dataset] plan = step_runner.plan(message) - distributor = Distributor.new(self) - distributor.distribute(plan) + distributor = Distributor.new(self, plan) + distributor.distribute rescue Droonga::UnsupportedMessageError => error target_message = error.message raise UnknownType.new(target_message["type"], target_message["dataset"]) Modified: lib/droonga/distributor.rb (+4 -3) =================================================================== --- lib/droonga/distributor.rb 2014-03-23 17:10:18 +0900 (1d7a11d) +++ lib/droonga/distributor.rb 2014-03-23 17:12:50 +0900 (bb7fbee) @@ -37,13 +37,14 @@ module Droonga include TSort - def initialize(dispatcher) + def initialize(dispatcher, plan) @dispatcher = dispatcher + @plan = plan end - def distribute(plan) + def distribute @dependency = {} - plan.each do |step| + @plan.each do |step| @dependency[step] = step["inputs"] next unless step["outputs"] step["outputs"].each do |output| -------------- next part -------------- HTML����������������������������...Download