Class: Kazoo::CLI::Cluster
- Inherits:
-
Thor
- Object
- Thor
- Kazoo::CLI::Cluster
- Includes:
- Common
- Defined in:
- lib/kazoo/cli/cluster.rb
Instance Method Summary collapse
Methods included from Common
Instance Method Details
#brokers ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/kazoo/cli/cluster.rb', line 7 def brokers kafka_cluster.brokers.values.sort_by(&:id).each do |broker| $stdout.puts "#{broker.id}:\t#{broker.addr}\t(hosts #{broker.replicated_partitions.length} partitions, leads #{broker.led_partitions.length})" end end |
#critical(broker_name) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/kazoo/cli/cluster.rb', line 17 def critical(broker_name) if broker(broker_name).critical?(replicas: [:replicas]) raise Thor::Error, "WARNING: broker #{broker_name} is critical and cannot be stopped safely!" else $stdout.puts "Broker #{broker_name} is non-critical and can be stopped safely." end end |
#election ⇒ Object
28 29 30 31 32 |
# File 'lib/kazoo/cli/cluster.rb', line 28 def election kafka_cluster.preferred_leader_election end |