Class: Kafka::FetchedBatch

Inherits:
Object
  • Object
show all
Defined in:
lib/kafka/fetched_batch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(topic:, partition:, highwater_mark_offset:, messages:) ⇒ FetchedBatch

Returns a new instance of FetchedBatch.



5
6
7
8
9
10
# File 'lib/kafka/fetched_batch.rb', line 5

def initialize(topic:, partition:, highwater_mark_offset:, messages:)
  @topic = topic
  @partition = partition
  @highwater_mark_offset = highwater_mark_offset
  @messages = messages
end

Instance Attribute Details

#highwater_mark_offsetObject (readonly)

Returns the value of attribute highwater_mark_offset.



3
4
5
# File 'lib/kafka/fetched_batch.rb', line 3

def highwater_mark_offset
  @highwater_mark_offset
end

#messagesObject (readonly)

Returns the value of attribute messages.



3
4
5
# File 'lib/kafka/fetched_batch.rb', line 3

def messages
  @messages
end

#partitionObject (readonly)

Returns the value of attribute partition.



3
4
5
# File 'lib/kafka/fetched_batch.rb', line 3

def partition
  @partition
end

#topicObject (readonly)

Returns the value of attribute topic.



3
4
5
# File 'lib/kafka/fetched_batch.rb', line 3

def topic
  @topic
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/kafka/fetched_batch.rb', line 12

def empty?
  @messages.empty?
end