Class: Kafkat::Command::Base
- Inherits:
-
Object
- Object
- Kafkat::Command::Base
- Includes:
- Kafkat::CommandIO, Formatting, Logging
- Defined in:
- lib/kafkat/command.rb
Direct Known Subclasses
Kafkat::ClusterRestart::Subcommands::Good, Kafkat::ClusterRestart::Subcommands::Help, Kafkat::ClusterRestart::Subcommands::Log, Kafkat::ClusterRestart::Subcommands::Next, Kafkat::ClusterRestart::Subcommands::Reset, Kafkat::ClusterRestart::Subcommands::Restore, Kafkat::ClusterRestart::Subcommands::Start, Brokers, CleanIndexes, ClusterRestart, Controller, Describe, Drain, ElectLeaders, Reassign, Resign, ResignForce, SetReplicationFactor, Topics, VerifyReassign, VerifyReplicas
Class Attribute Summary collapse
-
.command_name ⇒ Object
readonly
Returns the value of attribute command_name.
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Class Method Summary collapse
Instance Method Summary collapse
- #admin ⇒ Object
-
#initialize(config) ⇒ Base
constructor
A new instance of Base.
- #kafka_logs ⇒ Object
- #run ⇒ Object
- #zookeeper ⇒ Object
Methods included from Logging
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
#initialize(config) ⇒ Base
Returns a new instance of Base.
39 40 41 |
# File 'lib/kafkat/command.rb', line 39 def initialize(config) @config = config end |
Class Attribute Details
.command_name ⇒ Object (readonly)
Returns the value of attribute command_name.
23 24 25 |
# File 'lib/kafkat/command.rb', line 23 def command_name @command_name end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
20 21 22 |
# File 'lib/kafkat/command.rb', line 20 def config @config end |
Class Method Details
.register_as(name) ⇒ Object
26 27 28 29 |
# File 'lib/kafkat/command.rb', line 26 def self.register_as(name) @command_name = name Command.all[name] = self end |
.usage(format, description) ⇒ Object
35 36 37 |
# File 'lib/kafkat/command.rb', line 35 def self.usage(format, description) usages << [format, description] end |
.usages ⇒ Object
31 32 33 |
# File 'lib/kafkat/command.rb', line 31 def self.usages @usages ||= [] end |
Instance Method Details
#admin ⇒ Object
47 48 49 50 51 |
# File 'lib/kafkat/command.rb', line 47 def admin @admin ||= begin Interface::Admin.new(config) end end |
#kafka_logs ⇒ Object
59 60 61 62 63 |
# File 'lib/kafkat/command.rb', line 59 def kafka_logs @kafka_logs ||= begin Interface::KafkaLogs.new(config) end end |
#run ⇒ Object
43 44 45 |
# File 'lib/kafkat/command.rb', line 43 def run raise NotImplementedError end |