YUKI Hiroshi
null+****@clear*****
Wed Apr 29 01:34:53 JST 2015
YUKI Hiroshi 2015-04-29 01:34:53 +0900 (Wed, 29 Apr 2015) New Revision: 02f10e3d707abb76320cfffd81054bf88df14c4b https://github.com/droonga/droonga-engine/commit/02f10e3d707abb76320cfffd81054bf88df14c4b Message: Add "targetRole" field to the envelope to ignore not acceptable messages Modified files: bin/droonga-engine-join lib/droonga/data_absorber_client.rb lib/droonga/plugins/system/absorb_data.rb Modified: bin/droonga-engine-join (+1 -0) =================================================================== --- bin/droonga-engine-join 2015-04-29 01:25:38 +0900 (640e66b) +++ bin/droonga-engine-join 2015-04-29 01:34:53 +0900 (97d3b34) @@ -234,6 +234,7 @@ module Droonga :messages_per_second => @options["records-per-second"], :progress_interval_seconds => @options["progress-interval-seconds"], + :target_role => NodeRole::ABSORB_DESTINATION, :client_options => { :backend => :coolio, Modified: lib/droonga/data_absorber_client.rb (+2 -0) =================================================================== --- lib/droonga/data_absorber_client.rb 2015-04-29 01:25:38 +0900 (05e266a) +++ lib/droonga/data_absorber_client.rb 2015-04-29 01:34:53 +0900 (1b95c53) @@ -57,6 +57,7 @@ module Droonga DEFAULT_MESSAGES_PER_SECOND @progress_interval_seconds = @params[:progress_interval_seconds] || DEFAULT_PROGRESS_INTERVAL_SECONDS + @target_role = @params[:target_role] @host = @params[:host] || DEFAULT_HOST @port = @params[:port] || DEFAULT_PORT @@ -91,6 +92,7 @@ module Droonga "dataset" => @source_dataset, "messagesPerSecond" => @messages_per_second, "progressIntervalSeconds" => @progress_interval_seconds, + "targetRole" => @target_role, }, } client = Droonga::Client.new(destination_client_options) Modified: lib/droonga/plugins/system/absorb_data.rb (+5 -0) =================================================================== --- lib/droonga/plugins/system/absorb_data.rb 2015-04-29 01:25:38 +0900 (dd8f5ce) +++ lib/droonga/plugins/system/absorb_data.rb 2015-04-29 01:34:53 +0900 (bbff7ea) @@ -94,6 +94,7 @@ module Droonga @dumper_error_message =****@dumpe*****(dump_options) do |message| begin message["dataset"] = current_dataset + message["targetRole"] = target_role if target_role message["xSender"] = "system.absorb-data" @messenger.forward(message, "to" => my_node_name, @@ -335,6 +336,10 @@ module Droonga @request.dataset end + def target_role + @request.request["targetRole"] + end + def prepare_progress_interval_seconds interval_seconds =****@reque*****["progressIntervalSeconds"] || DEFAULT_PROGRESS_INTERVAL_SECONDS -------------- next part -------------- HTML����������������������������... 下載