Class: Gizzard::CopyCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/gizzard/commands.rb

Instance Attribute Summary

Attributes inherited from Command

#argv, #buffer, #command_options, #global_options, #job_injector, #manager

Instance Method Summary collapse

Methods inherited from Command

classify, #confirm!, #get_base_name, #help!, #initialize, make_job_injector, make_manager, #output, #require_tables, #require_template_options, run

Constructor Details

This class inherits a constructor from Gizzard::Command

Instance Method Details

#runObject



545
546
547
548
549
550
551
552
553
554
# File 'lib/gizzard/commands.rb', line 545

def run
  shard_id_strings = @argv
  help!("Requires at least two shard ids") unless shard_id_strings.size >= 2
  shard_ids = shard_id_strings.map{|s| ShardId.parse(s)}
  manager.copy_shard(shard_ids)
  sleep 2
  while manager.get_busy_shards().size > 0
    sleep 5
  end 
end