Sha256: cd5afe6978fb61efd93d2a0922d1f6bfe27df88f7709fddc5cf88aaf4e79640d

Contents?: true

Size: 663 Bytes

Versions: 6

Compression:

Stored size: 663 Bytes

Contents

module Kafka

  # An ordered sequence of messages fetched from a Kafka partition.
  class FetchedBatch
    # @return [String]
    attr_reader :topic

    # @return [Integer]
    attr_reader :partition

    # @return [Integer] the offset of the most recent message in the partition.
    attr_reader :highwater_mark_offset

    # @return [Array<Kafka::FetchedMessage>]
    attr_reader :messages

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

    def empty?
      @messages.empty?
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-kafka-0.3.8 lib/kafka/fetched_batch.rb
ruby-kafka-0.3.7 lib/kafka/fetched_batch.rb
ruby-kafka-0.3.6 lib/kafka/fetched_batch.rb
ruby-kafka-0.3.5 lib/kafka/fetched_batch.rb
ruby-kafka-0.3.4 lib/kafka/fetched_batch.rb
ruby-kafka-0.3.3 lib/kafka/fetched_batch.rb