Class: Kafkat::Partition
- Inherits:
-
Struct
- Object
- Struct
- Kafkat::Partition
- Defined in:
- lib/kafkat/cluster/partition.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#isr ⇒ Object
Returns the value of attribute isr.
-
#leader ⇒ Object
Returns the value of attribute leader.
-
#replicas ⇒ Object
Returns the value of attribute replicas.
-
#topic_name ⇒ Object
Returns the value of attribute topic_name.
Instance Method Summary collapse
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id
2 3 4 |
# File 'lib/kafkat/cluster/partition.rb', line 2 def id @id end |
#isr ⇒ Object
Returns the value of attribute isr
2 3 4 |
# File 'lib/kafkat/cluster/partition.rb', line 2 def isr @isr end |
#leader ⇒ Object
Returns the value of attribute leader
2 3 4 |
# File 'lib/kafkat/cluster/partition.rb', line 2 def leader @leader end |
#replicas ⇒ Object
Returns the value of attribute replicas
2 3 4 |
# File 'lib/kafkat/cluster/partition.rb', line 2 def replicas @replicas end |
#topic_name ⇒ Object
Returns the value of attribute topic_name
2 3 4 |
# File 'lib/kafkat/cluster/partition.rb', line 2 def topic_name @topic_name end |
Instance Method Details
#has_leader?(brokers) ⇒ Boolean
3 4 5 |
# File 'lib/kafkat/cluster/partition.rb', line 3 def has_leader?(brokers) leader && leader != -1 && brokers.include?(leader) end |
#under_replicated? ⇒ Boolean
7 8 9 |
# File 'lib/kafkat/cluster/partition.rb', line 7 def under_replicated? isr.size < replicas.size end |