YUKI Hiroshi
null+****@clear*****
Tue Oct 7 13:09:27 JST 2014
YUKI Hiroshi 2014-10-07 13:09:27 +0900 (Tue, 07 Oct 2014) New Revision: d6d03af40892692ed2f80b7367b3c8872c4c5343 https://github.com/droonga/droonga-engine/commit/d6d03af40892692ed2f80b7367b3c8872c4c5343 Message: Add an option to disable orchestration based on Serf. It is introduced to make a node working alone, for example, automated tests. Modified files: lib/droonga/command/droonga_engine.rb Modified: lib/droonga/command/droonga_engine.rb (+14 -4) =================================================================== --- lib/droonga/command/droonga_engine.rb 2014-10-07 12:46:12 +0900 (7e94a6c) +++ lib/droonga/command/droonga_engine.rb 2014-10-07 13:09:27 +0900 (55e3c12) @@ -114,7 +114,7 @@ module Droonga class Configuration attr_reader :host, :port, :tag, :log_file, :pid_file_path - attr_reader :ready_notify_fd + attr_reader :ready_notify_fd, :orchestrated def initialize config = load_config @@ -128,6 +128,7 @@ module Droonga @daemon = false @pid_file_path = nil @ready_notify_fd = nil + @orchestrated = true if have_config_file? if config.include?("daemon") @@ -224,6 +225,7 @@ module Droonga add_log_options(parser) add_process_options(parser) add_path_options(parser) + add_orchestration_options(parser) add_notification_options(parser) end @@ -308,6 +310,13 @@ module Droonga end end + def add_orchestration_options(parser) + parser.on("--no-orchestration", + "Disable orchestration with other nodes") do + @orchestrated = false + end + end + def add_notification_options(parser) parser.separator("") parser.separator("Notification:") @@ -339,7 +348,7 @@ module Droonga trap_signals @loop.run - @serf.stop if****@serf*****? + @serf.stop if @serf and****@serf*****? @service_runner.success? end @@ -380,14 +389,14 @@ module Droonga def stop_gracefully @command_runner.stop - @serf.stop + @serf.stop if @serf @catalog_observer.stop @service_runner.stop_gracefully end def stop_immediately @command_runner.stop - @serf.stop + @serf.stop if @serf @catalog_observer.stop @service_runner.stop_immediately end @@ -418,6 +427,7 @@ module Droonga end def run_serf + return nil unles****@confi***** serf = Serf.new(@loop, @configuration.engine_name) serf.start serf -------------- next part -------------- HTML����������������������������...Download