Class MessageIterator

java.lang.Object
org.apache.drill.exec.store.kafka.MessageIterator
All Implemented Interfaces:
AutoCloseable, Iterator<org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]>>

public class MessageIterator extends Object implements Iterator<org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]>>, AutoCloseable
  • Constructor Details

    • MessageIterator

      public MessageIterator(org.apache.kafka.clients.consumer.KafkaConsumer<byte[],byte[]> kafkaConsumer, KafkaPartitionScanSpec subScanSpec, long kafkaPollTimeOut)
  • Method Details

    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]>>
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]>>
    • getTotalFetchTime

      public long getTotalFetchTime()
      Returns total fetch time of the messages from topic. Only applicable if debug log level is enabled.
      Returns:
      calculated total fetch time if debug log level is enabled, 0 otherwise
    • next

      public org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> next()
      Specified by:
      next in interface Iterator<org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]>>
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable