Permalink
Browse files

Add --fast option to the reload command.

  • Loading branch information...
1 parent ece277f commit 4ddb144abc2494255f716134645eda6940d2c5f6 @hyungoo hyungoo committed Mar 15, 2012
Showing with 11 additions and 22 deletions.
  1. +5 −16 lib/gizzard/commands.rb
  2. +6 −6 lib/gizzmo.rb
View
@@ -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
View
@@ -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"])

0 comments on commit 4ddb144

Please sign in to comment.