Class ConsumerRecords<K,​V>

    • Field Detail

      • EMPTY

        public static final ConsumerRecords<java.lang.Object,​java.lang.Object> EMPTY
    • Method Detail

      • records

        public java.util.List<ConsumerRecord<K,​V>> records​(TopicPartition partition)
        Get just the records for the given partition
        Parameters:
        partition - The partition to get records for
      • records

        public java.lang.Iterable<ConsumerRecord<K,​V>> records​(java.lang.String topic)
        Get just the records for the given topic
      • partitions

        public java.util.Set<TopicPartition> partitions()
        Get the partitions which have records contained in this record set.
        Returns:
        the set of partitions with data in this record set (may be empty if no data was returned)
      • iterator

        public java.util.Iterator<ConsumerRecord<K,​V>> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<K>
      • count

        public int count()
        The number of records for all topics
      • isEmpty

        public boolean isEmpty()