org.apache.kafka.clients.consumer
Class ConsumerRecords

java.lang.Object
  extended by org.apache.kafka.clients.consumer.ConsumerRecords

public class ConsumerRecords
extends java.lang.Object

A container that holds the list ConsumerRecord per partition for a particular topic. There is one for every topic returned by a Consumer.poll(long) operation.


Constructor Summary
ConsumerRecords(java.lang.String topic, java.util.Map<java.lang.Integer,java.util.List<ConsumerRecord>> records)
           
 
Method Summary
 java.util.List<ConsumerRecord> records(int... partitions)
           
 java.lang.String topic()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsumerRecords

public ConsumerRecords(java.lang.String topic,
                       java.util.Map<java.lang.Integer,java.util.List<ConsumerRecord>> records)
Method Detail

records

public java.util.List<ConsumerRecord> records(int... partitions)
Parameters:
partitions - The input list of partitions for a particular topic. If no partitions are specified, returns records for all partitions
Returns:
The list of ConsumerRecords associated with the given partitions.

topic

public java.lang.String topic()
Returns:
The topic of all records associated with this instance