Class: Rdkafka::Consumer::Partition
- Inherits:
-
Object
- Object
- Rdkafka::Consumer::Partition
- Defined in:
- lib/rdkafka/consumer/partition.rb
Overview
Information about a partition, used in TopicPartitionList.
Instance Attribute Summary collapse
-
#err ⇒ Integer
readonly
Partition's error code.
-
#offset ⇒ Integer?
readonly
Partition's offset.
-
#partition ⇒ Integer
readonly
Partition number.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Whether another partition is equal to this.
-
#inspect ⇒ String
Human readable representation of this partition.
-
#to_s ⇒ String
Human readable representation of this partition.
Instance Attribute Details
#err ⇒ Integer (readonly)
Partition's error code
15 16 17 |
# File 'lib/rdkafka/consumer/partition.rb', line 15 def err @err end |
#offset ⇒ Integer? (readonly)
Partition's offset
11 12 13 |
# File 'lib/rdkafka/consumer/partition.rb', line 11 def offset @offset end |
#partition ⇒ Integer (readonly)
Partition number
7 8 9 |
# File 'lib/rdkafka/consumer/partition.rb', line 7 def partition @partition end |
Instance Method Details
#==(other) ⇒ Boolean
Whether another partition is equal to this
42 43 44 45 46 |
# File 'lib/rdkafka/consumer/partition.rb', line 42 def ==(other) self.class == other.class && self.partition == other.partition && self.offset == other.offset end |
#inspect ⇒ String
Human readable representation of this partition.
36 37 38 |
# File 'lib/rdkafka/consumer/partition.rb', line 36 def inspect to_s end |
#to_s ⇒ String
Human readable representation of this partition.
26 27 28 29 30 31 32 |
# File 'lib/rdkafka/consumer/partition.rb', line 26 def to_s = "<Partition #{partition}" += " offset=#{offset}" if offset += " err=#{err}" if err != 0 += ">" end |