Class: KafkaCommand::Partition
- Inherits:
-
Object
- Object
- KafkaCommand::Partition
- Extended by:
- Forwardable
- Defined in:
- app/models/kafka_command/partition.rb
Instance Attribute Summary collapse
-
#topic ⇒ Object
readonly
Returns the value of attribute topic.
Instance Method Summary collapse
- #as_json ⇒ Object
- #highwater_mark_offset ⇒ Object (also: #offset)
-
#initialize(partition_metadata, topic) ⇒ Partition
constructor
A new instance of Partition.
Constructor Details
#initialize(partition_metadata, topic) ⇒ Partition
Returns a new instance of Partition.
11 12 13 14 |
# File 'app/models/kafka_command/partition.rb', line 11 def initialize(, topic) @topic = topic @partition_metadata = end |
Instance Attribute Details
#topic ⇒ Object (readonly)
Returns the value of attribute topic.
8 9 10 |
# File 'app/models/kafka_command/partition.rb', line 8 def topic @topic end |
Instance Method Details
#as_json ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'app/models/kafka_command/partition.rb', line 21 def as_json(*) { isr: isr, leader: leader, id: partition_id, highwater_mark_offset: offset } end |
#highwater_mark_offset ⇒ Object Also known as: offset
16 17 18 |
# File 'app/models/kafka_command/partition.rb', line 16 def highwater_mark_offset @topic.offset_for(self) end |