Class: Kafkat::Command::ClusterRestart

Inherits:
Base
  • Object
show all
Defined in:
lib/kafkat/command/cluster_restart.rb

Instance Attribute Summary

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Base

#admin, #initialize, #kafka_logs, register_as, usage, usages, #zookeeper

Methods included from Logging

#print_err

Methods included from Kafkat::CommandIO

#prompt_and_execute_assignments

Methods included from Formatting

#justify, #print_assignment, #print_assignment_header, #print_broker, #print_broker_header, #print_partition, #print_partition_header, #print_topic, #print_topic_header, #print_topic_name

Constructor Details

This class inherits a constructor from Kafkat::Command::Base

Instance Method Details

#runObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/kafkat/command/cluster_restart.rb', line 9

def run
  subcommand_name = ARGV.shift || 'help'
  begin
    subcommand_class = ['Kafkat', 'ClusterRestart', 'Subcommands', subcommand_name.capitalize].inject(Object) do |mod, class_name|
      mod.const_get(class_name)
    end
    subcommand_class.new(config).run
  rescue NameError
    print "ERROR: Unknown command #{subcommand_name}"
  end
end