diff --git a/lib/gizzard/commands.rb b/lib/gizzard/commands.rb index 819f7b2..681e4fa 100644 --- a/lib/gizzard/commands.rb +++ b/lib/gizzard/commands.rb @@ -238,22 +238,11 @@ def down(id, depth = 0) class ReloadCommand < Command def run if global_options.force || ask - manager.reload_config - else - STDERR.puts "aborted" - end - end - - def ask - output "Are you sure? Reloading will affect production services immediately! (Type 'yes')" - gets.chomp == "yes" - end - end - - class ReloadUpdatedCommand < Command - def run - if global_options.force || ask - manager.reload_updated_forwardings + if command_options.fast + manager.reload_updated_forwardings + else + manager.reload_config + end else STDERR.puts "aborted" end diff --git a/lib/gizzmo.rb b/lib/gizzmo.rb index 42633dd..853ba7f 100644 --- a/lib/gizzmo.rb +++ b/lib/gizzmo.rb @@ -38,7 +38,6 @@ class HelpNeededError < RuntimeError; end "ping" => "Confirm that all configured application servers are accessible, and in agreement about the set of shard hosts.", "rebalance" => "Restructure and move shards to reflect a new list of tree structures.", "reload" => "Instruct application servers to reload the nameserver state.", - "reload-updated" => "Instruct application servers to partially reload the nameserver state - only the entries that have been updated since the last reload.", "remove-host" => "Remove a remote cluster host being replicate to.", "remove-partition" => "Rebalance the cluster by removing the provided partitions from the current topology.", "repair-tables" => "Reconcile all the shards in the given tables (supplied with -T) by detecting differences and writing them back to shards as needed.", @@ -278,14 +277,15 @@ def add_template_opts(subcommand_options, opts) opts.banner = "Usage: #{zero} info SHARD_ID [MORE SHARD_IDS...]" separators(opts, DOC_STRINGS["info"]) end, + 'reload' => OptionParser.new do |opts| - opts.banner = "Usage: #{zero} reload" + opts.banner = "Usage: #{zero} reload [--fast]" separators(opts, DOC_STRINGS["reload"]) + opts.on("--fast", "Reload only the entries that have been updated since the last reload.") do + subcommand_options.fast = true + end end, - 'reload-updated' => OptionParser.new do |opts| - opts.banner = "Usage: #{zero} reload-updated" - separators(opts, DOC_STRINGS["reload-updated"]) - end, + 'drill' => OptionParser.new do |opts| opts.banner = "Usage: #{zero} drill SIGNATURE" separators(opts, DOC_STRINGS["drill"])