Class: Kafkat::Command::Base
- Inherits:
-
Object
- Object
- Kafkat::Command::Base
- Includes:
- Kafkat::CommandIO, Formatting
- Defined in:
- lib/kafkat/command.rb
Direct Known Subclasses
Brokers, CleanIndexes, Controller, Describe, Drain, ElectLeaders, Reassign, Resign, ResignForce, SetReplicationFactor, Topics
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 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
Constructor Details
#initialize(config) ⇒ Base
Returns a new instance of Base.
38 39 40 |
# File 'lib/kafkat/command.rb', line 38 def initialize(config) @config = config end |
Class Attribute Details
.command_name ⇒ Object (readonly)
Returns the value of attribute command_name.
22 23 24 |
# File 'lib/kafkat/command.rb', line 22 def command_name @command_name end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
19 20 21 |
# File 'lib/kafkat/command.rb', line 19 def config @config end |
Class Method Details
.register_as(name) ⇒ Object
25 26 27 28 |
# File 'lib/kafkat/command.rb', line 25 def self.register_as(name) @command_name = name Command.all[name] = self end |
.usage(format, description) ⇒ Object
34 35 36 |
# File 'lib/kafkat/command.rb', line 34 def self.usage(format, description) usages << [format, description] end |
.usages ⇒ Object
30 31 32 |
# File 'lib/kafkat/command.rb', line 30 def self.usages @usages ||= [] end |
Instance Method Details
#admin ⇒ Object
46 47 48 49 50 |
# File 'lib/kafkat/command.rb', line 46 def admin @admin ||= begin Interface::Admin.new(config) end end |
#kafka_logs ⇒ Object
58 59 60 61 62 |
# File 'lib/kafkat/command.rb', line 58 def kafka_logs @kafka_logs ||= begin Interface::KafkaLogs.new(config) end end |
#run ⇒ Object
42 43 44 |
# File 'lib/kafkat/command.rb', line 42 def run raise NotImplementedError end |