librdkafka
The Apache Kafka C/C++ client library
RdKafka::TopicPartition Class Referenceabstract

Topic+Partition. More...

#include <rdkafkacpp.h>

Public Member Functions

virtual const std::string & topic () const =0
 
virtual int partition () const =0
 
virtual int64_t offset () const =0
 
virtual void set_offset (int64_t offset)=0
 Set offset.
 
virtual ErrorCode err () const =0
 

Static Public Member Functions

static TopicPartitioncreate (const std::string &topic, int partition)
 
static TopicPartitioncreate (const std::string &topic, int partition, int64_t offset)
 
static void destroy (std::vector< TopicPartition *> &partitions)
 Destroy/delete the TopicPartitions in partitions and clear the vector.
 

Detailed Description

Topic+Partition.

This is a generic type to hold a single partition and various information about it.

Is typically used with std::vector<RdKafka::TopicPartition*> to provide a list of partitions for different operations.

Member Function Documentation

§ create()

static TopicPartition* RdKafka::TopicPartition::create ( const std::string &  topic,
int  partition 
)
static

Create topic+partition object for topic and partition and optionally offset.

Use delete to deconstruct.

§ topic()

virtual const std::string& RdKafka::TopicPartition::topic ( ) const
pure virtual
Returns
topic name

§ partition()

virtual int RdKafka::TopicPartition::partition ( ) const
pure virtual
Returns
partition id

§ offset()

virtual int64_t RdKafka::TopicPartition::offset ( ) const
pure virtual
Returns
offset (if applicable)

§ err()

virtual ErrorCode RdKafka::TopicPartition::err ( ) const
pure virtual
Returns
error code (if applicable)

The documentation for this class was generated from the following file: