com.taosdata.jdbc.tmq

## Class ConsumerRecords<V>

- java.lang.Object
- - com.taosdata.jdbc.tmq.ConsumerRecords<V>

All Implemented Interfaces:
  Iterable<ConsumerRecord<V>>

    public class ConsumerRecords<V>
    extends Object
    implements Iterable<ConsumerRecord<V>>

### Field Summary

Fields
`static ConsumerRecords<?>` `EMPTY`

### Constructor Summary

Constructors
Constructor and Description
`ConsumerRecords()`
`ConsumerRecords(Map<TopicPartition,List<ConsumerRecord<V>>> records)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`int` `count()` The number of records for all topics
`static <T> ConsumerRecords<T>` `emptyRecord()`
`List<ConsumerRecord<V>>` `get(TopicPartition partition)`
`boolean` `isEmpty()`
`Iterator<ConsumerRecord<V>>` `iterator()`
`Set<TopicPartition>` `partitions()` Get the partitions which have records contained in this record set.
`void` `put(TopicPartition tp, ConsumerRecord<V> r)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

### Field Detail

#### EMPTY

    public static final ConsumerRecords<?> EMPTY

### Constructor Detail

#### ConsumerRecords

    public ConsumerRecords(Map<TopicPartition,List<ConsumerRecord<V>>> records)

#### ConsumerRecords

    public ConsumerRecords()

### Method Detail

#### partitions

    public 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)

#### count

    public int count()

The number of records for all topics

#### put

    public void put(TopicPartition tp,
                    ConsumerRecord<V> r)

#### get

    public List<ConsumerRecord<V>> get(TopicPartition partition)

#### iterator

    public Iterator<ConsumerRecord<V>> iterator()

Specified by:
  `iterator` in interface `Iterable<ConsumerRecord<V>>`

#### isEmpty

    public boolean isEmpty()

#### emptyRecord

    public static <T> ConsumerRecords<T> emptyRecord()