## 类的使用
com.taosdata.jdbc.tmq.TopicPartition

使用TopicPartition的程序包
com.taosdata.jdbc.common
com.taosdata.jdbc.tmq
com.taosdata.jdbc.ws.tmq
com.taosdata.jdbc.ws.tmq.entity

### com.taosdata.jdbc.common中TopicPartition的使用

返回变量类型为TopicPartition的类型的com.taosdata.jdbc.common中的方法
`Set<TopicPartition>` Consumer.`assignment()` Get the set of partitions currently assigned to this consumer.
`Map<TopicPartition,Long>` Consumer.`beginningOffsets(String topic)`
`Map<TopicPartition,OffsetAndMetadata>` Consumer.`committed(Set<TopicPartition> partitions)`
`Map<TopicPartition,Long>` Consumer.`endOffsets(String topic)`
`Map<TopicPartition,Long>` Consumer.`position(String topic)`

参数类型为TopicPartition的com.taosdata.jdbc.common中的方法
`OffsetAndMetadata` Consumer.`committed(TopicPartition partition)` Get the last committed offset for the given partition.
`long` Consumer.`position(TopicPartition partition)` Get the offset of the next record that will be fetched.
`void` Consumer.`seek(TopicPartition partition, long offset)` If this API is invoked for the same partition more than once, the latest offset will be used on the next poll().

类型变量类型为TopicPartition的com.taosdata.jdbc.common中的方法参数
`void` Consumer.`commitAsync(Map<TopicPartition,OffsetAndMetadata> offsets, OffsetCommitCallback<V> callback)`
`void` Consumer.`commitSync(Map<TopicPartition,OffsetAndMetadata> offsets)`
`Map<TopicPartition,OffsetAndMetadata>` Consumer.`committed(Set<TopicPartition> partitions)`
`void` Consumer.`seekToBeginning(Collection<TopicPartition> partitions)`
`void` Consumer.`seekToEnd(Collection<TopicPartition> partitions)`

### com.taosdata.jdbc.tmq中TopicPartition的使用

返回变量类型为TopicPartition的类型的com.taosdata.jdbc.tmq中的方法
`Set<TopicPartition>` TaosConsumer.`assignment()`
`Set<TopicPartition>` JNIConsumer.`assignment()`
`Map<TopicPartition,Long>` TaosConsumer.`beginningOffsets(String topic)`
`Map<TopicPartition,Long>` JNIConsumer.`beginningOffsets(String topic)`
`Map<TopicPartition,OffsetAndMetadata>` TaosConsumer.`committed(Set<TopicPartition> partitions)`
`Map<TopicPartition,OffsetAndMetadata>` JNIConsumer.`committed(Set<TopicPartition> partitions)`
`Map<TopicPartition,Long>` TaosConsumer.`endOffsets(String topic)`
`Map<TopicPartition,Long>` JNIConsumer.`endOffsets(String topic)`
`Set<TopicPartition>` ConsumerRecords.`partitions()` Get the partitions which have records contained in this record set.
`Map<TopicPartition,Long>` TaosConsumer.`position(String topic)`
`Map<TopicPartition,Long>` JNIConsumer.`position(String topic)`

参数类型为TopicPartition的com.taosdata.jdbc.tmq中的方法
`OffsetAndMetadata` TaosConsumer.`committed(TopicPartition partition)`
`OffsetAndMetadata` JNIConsumer.`committed(TopicPartition partition)`
`List<ConsumerRecord<V>>` ConsumerRecords.`get(TopicPartition partition)`
`long` TaosConsumer.`position(TopicPartition tp)`
`long` JNIConsumer.`position(TopicPartition partition)`
`void` ConsumerRecords.`put(TopicPartition tp, ConsumerRecord<V> r)`
`void` TaosConsumer.`seek(TopicPartition partition, long offset)`
`void` JNIConsumer.`seek(TopicPartition partition, long offset)`

类型变量类型为TopicPartition的com.taosdata.jdbc.tmq中的方法参数
`void` TaosConsumer.`commitAsync(Map<TopicPartition,OffsetAndMetadata> offsets, OffsetCommitCallback<V> callback)`
`void` JNIConsumer.`commitAsync(Map<TopicPartition,OffsetAndMetadata> offsets, OffsetCommitCallback<V> callback)`
`void` TaosConsumer.`commitSync(Map<TopicPartition,OffsetAndMetadata> offsets)`
`void` JNIConsumer.`commitSync(Map<TopicPartition,OffsetAndMetadata> offsets)`
`Map<TopicPartition,OffsetAndMetadata>` TaosConsumer.`committed(Set<TopicPartition> partitions)`
`Map<TopicPartition,OffsetAndMetadata>` JNIConsumer.`committed(Set<TopicPartition> partitions)`
`void` OffsetCommitCallback.`onComplete(Map<TopicPartition,OffsetAndMetadata> offsets, Exception exception)`
`void` TaosConsumer.`seekToBeginning(Collection<TopicPartition> partitions)`
`void` JNIConsumer.`seekToBeginning(Collection<TopicPartition> partitions)`
`void` TaosConsumer.`seekToEnd(Collection<TopicPartition> partitions)`
`void` JNIConsumer.`seekToEnd(Collection<TopicPartition> partitions)`

类型变量类型为TopicPartition的com.taosdata.jdbc.tmq中的构造器参数
构造器和说明
`ConsumerRecords(Map<TopicPartition,List<ConsumerRecord<V>>> records)`
`OffsetWaitCallback(Map<TopicPartition,OffsetAndMetadata> offsets, JNIConsumer<?> consumer, OffsetCommitCallback<V> callback)`

### com.taosdata.jdbc.ws.tmq中TopicPartition的使用

返回变量类型为TopicPartition的类型的com.taosdata.jdbc.ws.tmq中的方法
`Set<TopicPartition>` WSConsumer.`assignment()`
`Map<TopicPartition,Long>` WSConsumer.`beginningOffsets(String topic)`
`Map<TopicPartition,OffsetAndMetadata>` WSConsumer.`committed(Set<TopicPartition> partitions)`
`Map<TopicPartition,Long>` WSConsumer.`endOffsets(String topic)`
`Map<TopicPartition,Long>` WSConsumer.`position(String topic)`

参数类型为TopicPartition的com.taosdata.jdbc.ws.tmq中的方法
`OffsetAndMetadata` WSConsumer.`committed(TopicPartition partition)`
`long` WSConsumer.`position(TopicPartition partition)`
`void` WSConsumer.`seek(TopicPartition partition, long offset)`

类型变量类型为TopicPartition的com.taosdata.jdbc.ws.tmq中的方法参数
`void` WSConsumer.`commitAsync(Map<TopicPartition,OffsetAndMetadata> offsets, OffsetCommitCallback<V> callback)`
`void` WSConsumer.`commitSync(Map<TopicPartition,OffsetAndMetadata> offsets)`
`Map<TopicPartition,OffsetAndMetadata>` WSConsumer.`committed(Set<TopicPartition> partitions)`
`void` WSConsumer.`seekToBeginning(Collection<TopicPartition> partitions)`
`void` WSConsumer.`seekToEnd(Collection<TopicPartition> partitions)`

### com.taosdata.jdbc.ws.tmq.entity中TopicPartition的使用

返回TopicPartition的com.taosdata.jdbc.ws.tmq.entity中的方法
`TopicPartition[]` PositionReq.`getTopicPartitions()`
`TopicPartition[]` CommittedReq.`getTopicPartitions()`

参数类型为TopicPartition的com.taosdata.jdbc.ws.tmq.entity中的方法
`Request` TMQRequestFactory.`generateCommitOffset(TopicPartition topicPartition, long offset)`
`Request` TMQRequestFactory.`generateCommitted(TopicPartition[] topicPartitions)`
`Request` TMQRequestFactory.`generatePosition(TopicPartition[] topicPartitions)`
`void` PositionReq.`setTopicPartitions(TopicPartition[] topicPartitions)`
`void` CommittedReq.`setTopicPartitions(TopicPartition[] topicPartitions)`