Class: Rdkafka::Consumer::Partition

Inherits:
Object
  • Object
show all
Defined in:
lib/rdkafka/consumer/partition.rb

Overview

Information about a partition, used in TopicPartitionList.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#offsetInteger (readonly)

Partition's offset

Returns:

  • (Integer)


11
12
13
# File 'lib/rdkafka/consumer/partition.rb', line 11

def offset
  @offset
end

#partitionInteger (readonly)

Partition number

Returns:

  • (Integer)


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

Returns:

  • (Boolean)


33
34
35
36
37
# File 'lib/rdkafka/consumer/partition.rb', line 33

def ==(other)
  self.class == other.class &&
    self.partition == other.partition &&
    self.offset == other.offset
end

#inspectString

Human readable representation of this partition.

Returns:

  • (String)


27
28
29
# File 'lib/rdkafka/consumer/partition.rb', line 27

def inspect
  to_s
end

#to_sString

Human readable representation of this partition.

Returns:

  • (String)


21
22
23
# File 'lib/rdkafka/consumer/partition.rb', line 21

def to_s
  "<Partition #{partition} with offset #{offset}>"
end