Class: Kafka::FFI::TopicPartition

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/kafka/ffi/topic_partition.rb

Instance Method Summary collapse

Instance Method Details

#errornil, Kafka::ResponseError

Returns:

  • (nil)

    The TopicPartition does not have an error set

  • (Kafka::ResponseError)

    Error for this topic occurred related to the action the TopicPartition (or TopicPartitionList) was passed to.



21
22
23
24
25
# File 'lib/kafka/ffi/topic_partition.rb', line 21

def error
  if self[:err] != :ok
    ::Kafka::ResponseError.new(self[:err])
  end
end

#offsetInteger

Returns Known offset for the consumer group for topic + partition.

Returns:

  • (Integer)

    Known offset for the consumer group for topic + partition.



39
40
41
# File 'lib/kafka/ffi/topic_partition.rb', line 39

def offset
  self[:offset]
end

#partitionInteger

Returns Partition number.

Returns:

  • (Integer)

    Partition number



33
34
35
# File 'lib/kafka/ffi/topic_partition.rb', line 33

def partition
  self[:partition]
end

#topicString

Returns Name of the topic.

Returns:

  • (String)

    Name of the topic



28
29
30
# File 'lib/kafka/ffi/topic_partition.rb', line 28

def topic
  self[:topic]
end