Struct rdkafka::admin::AdminClient
source · pub struct AdminClient<C: ClientContext + 'static> { /* private fields */ }
Expand description
A client for the Kafka admin API.
AdminClient
provides programmatic access to managing a Kafka cluster,
notably manipulating topics, partitions, and configuration paramaters.
Implementations§
source§impl<C: ClientContext> AdminClient<C>
impl<C: ClientContext> AdminClient<C>
sourcepub fn create_topics<'a, I>(
&self,
topics: I,
opts: &AdminOptions,
) -> impl Future<Output = KafkaResult<Vec<TopicResult>>>where
I: IntoIterator<Item = &'a NewTopic<'a>>,
pub fn create_topics<'a, I>(
&self,
topics: I,
opts: &AdminOptions,
) -> impl Future<Output = KafkaResult<Vec<TopicResult>>>where
I: IntoIterator<Item = &'a NewTopic<'a>>,
Creates new topics according to the provided NewTopic
specifications.
Note that while the API supports creating multiple topics at once, it is not transactional. Creation of some topics may succeed while others fail. Be sure to check the result of each individual operation.
sourcepub fn delete_topics(
&self,
topic_names: &[&str],
opts: &AdminOptions,
) -> impl Future<Output = KafkaResult<Vec<TopicResult>>>
pub fn delete_topics( &self, topic_names: &[&str], opts: &AdminOptions, ) -> impl Future<Output = KafkaResult<Vec<TopicResult>>>
Deletes the named topics.
Note that while the API supports deleting multiple topics at once, it is not transactional. Deletion of some topics may succeed while others fail. Be sure to check the result of each individual operation.
sourcepub fn create_partitions<'a, I>(
&self,
partitions: I,
opts: &AdminOptions,
) -> impl Future<Output = KafkaResult<Vec<TopicResult>>>where
I: IntoIterator<Item = &'a NewPartitions<'a>>,
pub fn create_partitions<'a, I>(
&self,
partitions: I,
opts: &AdminOptions,
) -> impl Future<Output = KafkaResult<Vec<TopicResult>>>where
I: IntoIterator<Item = &'a NewPartitions<'a>>,
Adds additional partitions to existing topics according to the provided
NewPartitions
specifications.
Note that while the API supports creating partitions for multiple topics at once, it is not transactional. Creation of partitions for some topics may succeed while others fail. Be sure to check the result of each individual operation.
sourcepub fn delete_records(
&self,
offsets: &TopicPartitionList,
opts: &AdminOptions,
) -> impl Future<Output = KafkaResult<TopicPartitionList>>
pub fn delete_records( &self, offsets: &TopicPartitionList, opts: &AdminOptions, ) -> impl Future<Output = KafkaResult<TopicPartitionList>>
Deletes records from a topic.
The provided offsets
is a topic partition list specifying which
records to delete from a list of topic partitions. For each entry in the
list, the messages at offsets before the specified offsets (exclusive)
in the specified partition will be deleted. Use offset [Offset::End
]
to delete all records in the partition.
Returns a topic partition list describing the result of the deletion. If the operation succeeded for a partition, the offset for that partition will be set to the post-deletion low-water mark for that partition. If the operation failed for a partition, there will be an error for that partition’s entry in the list.
sourcepub fn describe_configs<'a, I>(
&self,
configs: I,
opts: &AdminOptions,
) -> impl Future<Output = KafkaResult<Vec<ConfigResourceResult>>>where
I: IntoIterator<Item = &'a ResourceSpecifier<'a>>,
pub fn describe_configs<'a, I>(
&self,
configs: I,
opts: &AdminOptions,
) -> impl Future<Output = KafkaResult<Vec<ConfigResourceResult>>>where
I: IntoIterator<Item = &'a ResourceSpecifier<'a>>,
Retrieves the configuration parameters for the specified resources.
Note that while the API supports describing multiple configurations at once, it is not transactional. There is no guarantee that you will see a consistent snapshot of the configuration across different resources.
sourcepub fn alter_configs<'a, I>(
&self,
configs: I,
opts: &AdminOptions,
) -> impl Future<Output = KafkaResult<Vec<AlterConfigsResult>>>where
I: IntoIterator<Item = &'a AlterConfig<'a>>,
pub fn alter_configs<'a, I>(
&self,
configs: I,
opts: &AdminOptions,
) -> impl Future<Output = KafkaResult<Vec<AlterConfigsResult>>>where
I: IntoIterator<Item = &'a AlterConfig<'a>>,
Sets configuration parameters for the specified resources.
Note that while the API supports altering multiple resources at once, it is not transactional. Alteration of some resources may succeed while others fail. Be sure to check the result of each individual operation.