Modern C++ Kafka API
Public Member Functions | List of all members
KAFKA_API::clients::admin::AdminClient Class Reference

The administrative client for Kafka, which supports managing and inspecting topics, etc. More...

#include <AdminClient.h>

Inheritance diagram for KAFKA_API::clients::admin::AdminClient:
KAFKA_API::clients::KafkaClient

Public Member Functions

 AdminClient (const Properties &properties)
 
admin::CreateTopicsResult createTopics (const Topics &topics, int numPartitions, int replicationFactor, const Properties &topicConfig=Properties(), std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_COMMAND_TIMEOUT_MS))
 Create a batch of new topics.
 
admin::DeleteTopicsResult deleteTopics (const Topics &topics, std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_COMMAND_TIMEOUT_MS))
 Delete a batch of topics.
 
admin::ListTopicsResult listTopics (std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_COMMAND_TIMEOUT_MS))
 List the topics available in the cluster.
 
admin::DeleteRecordsResult deleteRecords (const TopicPartitionOffsets &topicPartitionOffsets, std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_COMMAND_TIMEOUT_MS))
 Delete records whose offset is smaller than the given offset of the corresponding partition. More...
 
- Public Member Functions inherited from KAFKA_API::clients::KafkaClient
const std::string & clientId () const
 Get the client id.
 
const std::string & name () const
 Get the client name (i.e. More...
 
void setLogLevel (int level)
 Set log level for the kafka client (the default value: 5).
 
const Propertiesproperties () const
 Return the properties which took effect.
 
Optional< std::string > getProperty (const std::string &name) const
 Fetch the effected property (including the property internally set by librdkafka).
 
void pollEvents (std::chrono::milliseconds timeout)
 Call the OffsetCommit callbacks (if any) Note: The Kafka client should be constructed with option enable.manual.events.poll=true!
 
Optional< BrokerMetadatafetchBrokerMetadata (const std::string &topic, std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_METADATA_TIMEOUT_MS), bool disableErrorLogging=false)
 Fetch matadata from a available broker. More...
 
template<class ... Args>
void doLog (int level, const char *filename, int lineno, const char *format, Args... args) const
 
void doLog (int level, const char *filename, int lineno, const char *msg) const
 

Additional Inherited Members

- Public Types inherited from KAFKA_API::clients::KafkaClient
enum  { DEFAULT_METADATA_TIMEOUT_MS = 10000 }
 

Detailed Description

The administrative client for Kafka, which supports managing and inspecting topics, etc.

Member Function Documentation

◆ deleteRecords()

admin::DeleteRecordsResult KAFKA_API::clients::admin::AdminClient::deleteRecords ( const TopicPartitionOffsets &  topicPartitionOffsets,
std::chrono::milliseconds  timeout = std::chrono::milliseconds(DEFAULT_COMMAND_TIMEOUT_MS) 
)
inline

Delete records whose offset is smaller than the given offset of the corresponding partition.

Parameters
topicPartitionOffsetsa batch of offsets for partitions
timeout
Returns

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