Skip to main content

KafkaAdminClient

Struct KafkaAdminClient 

Source
pub struct KafkaAdminClient { /* private fields */ }
Expand description

The default implementation of Admin. An instance of this class is created by invoking AdminClient::create. Users should not refer to this class directly.

This class is thread-safe.

Trait Implementations§

Source§

impl Admin for KafkaAdminClient

Source§

fn create_topics_with_options( &self, new_topics: &[NewTopic], options: CreateTopicsOptions, ) -> CreateTopicsResult

Create a batch of new topics. Read more
Source§

fn delete_topics_with_topic_collection_options( &self, topics: TopicCollection, options: DeleteTopicsOptions, ) -> DeleteTopicsResult

Delete a batch of topics. Read more
Source§

fn list_topics_with_options( &self, options: ListTopicsOptions, ) -> ListTopicsResult

List the topics available in the cluster. Read more
Source§

fn describe_topics_with_topics_options( &self, topics: TopicCollection, options: DescribeTopicsOptions, ) -> DescribeTopicsResult

Describe some topics in the cluster. When using topic IDs, this operation is supported by brokers with version 3.1.0 or higher. Read more
Source§

fn create_partitions_with_options( &self, new_partitions: &HashMap<String, NewPartitions>, options: CreatePartitionsOptions, ) -> CreatePartitionsResult

Increase the number of partitions of the topics given as the keys of new_partitions according to the corresponding values. If partitions are increased for a topic that has a key, the partition logic or ordering of the messages will be affected. Read more
Source§

fn delete_records_with_options( &self, records_to_delete: &HashMap<TopicPartition, RecordsToDelete>, options: DeleteRecordsOptions, ) -> DeleteRecordsResult

Delete records whose offset is smaller than the given offset of the corresponding partition. Read more
Source§

fn describe_producers_with_options( &self, partitions: &[TopicPartition], options: DescribeProducersOptions, ) -> DescribeProducersResult

Describe active producer state on a set of topic partitions. Unless a specific broker is requested through DescribeProducersOptions::broker_id, this will query the partition leader to find the producer state. Read more
Source§

fn unregister_controller_with_options( &self, controller_id: i32, options: UnregisterControllerOptions, ) -> UnregisterControllerResult

Unregister a controller. The following errors can be anticipated when calling get() on the future from the returned UnregisterControllerResult: Read more
Source§

fn abort_transaction_with_options( &self, spec: AbortTransactionSpec, options: AbortTransactionOptions, ) -> AbortTransactionResult

Forcefully abort a transaction which is open on a topic partition. This will send a WriteTxnMarkers request to the partition leader in order to abort the transaction. This requires administrative privileges. Read more
Source§

fn describe_transactions_with_options( &self, transactional_ids: &[String], options: DescribeTransactionsOptions, ) -> DescribeTransactionsResult

Describe the state of a set of transactional IDs from the respective transaction coordinators, which are dynamically discovered. Read more
Source§

fn fence_producers_with_options( &self, transactional_ids: &[String], options: FenceProducersOptions, ) -> FenceProducersResult

Fence out all active producers that use any of the provided transactional IDs. Read more
Source§

fn list_transactions_with_options( &self, options: ListTransactionsOptions, ) -> ListTransactionsResult

List active transactions in the cluster. This will query all potential transaction coordinators in the cluster and collect the state of all transactions. Users should typically attempt to reduce the size of the result set using ListTransactionsOptions::filter_producer_ids or ListTransactionsOptions::filter_states or ListTransactionsOptions::filter_on_duration. Read more
Source§

fn force_terminate_transaction_with_options( &self, transactional_id: &str, options: TerminateTransactionOptions, ) -> TerminateTransactionResult

Force terminate a transaction for the given transactional ID. This operation aborts any ongoing transaction associated with the transactional ID. It’s similar to fenceProducers but only targets a single transactional ID to handle long-running transactions when 2PC is enabled. Read more
Source§

fn describe_cluster_with_options( &self, options: DescribeClusterOptions, ) -> DescribeClusterResult

Get information about the nodes in the cluster. Read more
Source§

fn describe_configs_with_options( &self, config_resources: &[ConfigResource], options: DescribeConfigsOptions, ) -> DescribeConfigsResult

Get the configuration for the specified resources. Read more
Source§

fn incremental_alter_configs_with_options( &self, configs: &HashMap<ConfigResource, Vec<AlterConfigOp>>, options: AlterConfigsOptions, ) -> AlterConfigsResult

Incrementally update the configuration for the specified resources. Read more
Source§

fn list_config_resources_with_options( &self, config_resource_types: &HashSet<Type>, options: ListConfigResourcesOptions, ) -> ListConfigResourcesResult

List the configuration resources available in the cluster which matches config resource type. If no config resource types are specified, all configuration resources will be listed. Read more
Source§

fn describe_log_dirs_with_options( &self, brokers: &[i32], options: DescribeLogDirsOptions, ) -> DescribeLogDirsResult

Query the information of all log directories on the given set of brokers Read more
Source§

fn alter_replica_log_dirs_with_options( &self, replica_assignment: &HashMap<TopicPartitionReplica, String>, options: AlterReplicaLogDirsOptions, ) -> AlterReplicaLogDirsResult

Change the log directory for the specified replicas. If the replica does not exist on the broker, the result shows REPLICA_NOT_AVAILABLE for the given replica and the replica will be created in the given log directory on the broker when it is created later. If the replica already exists on the broker, the replica will be moved to the given log directory if it is not already there. For detailed result, inspect the returned AlterReplicaLogDirsResult instance. Read more
Source§

fn describe_replica_log_dirs_with_options( &self, replicas: &[TopicPartitionReplica], options: DescribeReplicaLogDirsOptions, ) -> DescribeReplicaLogDirsResult

Query the replica log directory information for the specified replicas. Read more
Source§

fn elect_leaders_with_options( &self, election_type: ElectionType, partitions: Option<HashSet<TopicPartition>>, options: ElectLeadersOptions, ) -> ElectLeadersResult

Elect a replica as leader for the given partitions, or for all partitions if the argument to partitions is None. Read more
Source§

fn alter_partition_reassignments_with_options( &self, reassignments: &HashMap<TopicPartition, Option<NewPartitionReassignment>>, options: AlterPartitionReassignmentsOptions, ) -> AlterPartitionReassignmentsResult

Change the reassignments for one or more partitions. Providing None will revert the reassignment for the associated partition. Read more
Source§

fn list_partition_reassignments_with_partitions_options( &self, partitions: Option<HashSet<TopicPartition>>, options: ListPartitionReassignmentsOptions, ) -> ListPartitionReassignmentsResult

List the current reassignments for the given partitions. Read more
Source§

fn list_offsets_with_options( &self, topic_partition_offsets: &HashMap<TopicPartition, OffsetSpec>, options: ListOffsetsOptions, ) -> ListOffsetsResult

List offset for the specified partitions. This operation enables to find the beginning offset, end offset as well as the offset matching a timestamp in partitions. Read more
Source§

fn list_groups_with_options( &self, options: ListGroupsOptions, ) -> ListGroupsResult

List the groups available in the cluster. Read more
Source§

fn describe_consumer_groups_with_options( &self, group_ids: &[String], options: DescribeConsumerGroupsOptions, ) -> DescribeConsumerGroupsResult

Describe some consumer groups in the cluster. Read more
Source§

fn describe_classic_groups_with_options( &self, group_ids: &[String], options: DescribeClassicGroupsOptions, ) -> DescribeClassicGroupsResult

Describe some classic groups in the cluster. Read more
Source§

fn list_consumer_group_offsets_with_group_specs_options( &self, group_specs: &HashMap<String, ListConsumerGroupOffsetsSpec>, options: ListConsumerGroupOffsetsOptions, ) -> ListConsumerGroupOffsetsResult

List the consumer group offsets available in the cluster for the specified consumer groups. Read more
Source§

fn alter_consumer_group_offsets_with_options( &self, group_id: &str, offsets: &HashMap<TopicPartition, OffsetAndMetadata>, options: AlterConsumerGroupOffsetsOptions, ) -> AlterConsumerGroupOffsetsResult

Alters offsets for the specified group. In order to succeed, the group must be empty. Read more
Source§

fn delete_consumer_group_offsets_with_options( &self, group_id: &str, partitions: &HashSet<TopicPartition>, options: DeleteConsumerGroupOffsetsOptions, ) -> DeleteConsumerGroupOffsetsResult

Delete committed offsets for a set of partitions in a consumer group. This will succeed at the partition level only if the group is not actively subscribed to the corresponding topic. Read more
Source§

fn delete_consumer_groups_with_options( &self, group_ids: &[String], options: DeleteConsumerGroupsOptions, ) -> DeleteConsumerGroupsResult

Delete consumer groups from the cluster. Read more
Source§

fn remove_members_from_consumer_group_with_options( &self, group_id: &str, options: RemoveMembersFromConsumerGroupOptions, ) -> RemoveMembersFromConsumerGroupResult

Remove members from the consumer group by given member identities. Read more
Source§

fn create_acls_with_options( &self, acls: &[AclBinding], options: CreateAclsOptions, ) -> CreateAclsResult

Creates access control lists (ACLs) which are bound to specific resources. Read more
Source§

fn describe_acls_with_options( &self, filter: &AclBindingFilter, options: DescribeAclsOptions, ) -> DescribeAclsResult

Lists access control lists (ACLs) according to the supplied filter. Read more
Source§

fn delete_acls_with_options( &self, filters: &[AclBindingFilter], options: DeleteAclsOptions, ) -> DeleteAclsResult

Deletes access control lists (ACLs) according to the supplied filters. Read more
Source§

fn describe_client_quotas_with_options( &self, filter: &ClientQuotaFilter, options: DescribeClientQuotasOptions, ) -> DescribeClientQuotasResult

Describes all entities matching the provided filter that have at least one client quota configuration value defined. Read more
Source§

fn alter_client_quotas_with_options( &self, entries: &[ClientQuotaAlteration], options: AlterClientQuotasOptions, ) -> AlterClientQuotasResult

Alters client quota configurations with the specified alterations. Read more
Source§

fn describe_user_scram_credentials_with_users_options( &self, users: &[String], options: DescribeUserScramCredentialsOptions, ) -> DescribeUserScramCredentialsResult

Describe SASL/SCRAM credentials. Read more
Source§

fn alter_user_scram_credentials_with_options( &self, alterations: &[UserScramCredentialAlteration], options: AlterUserScramCredentialsOptions, ) -> AlterUserScramCredentialsResult

Alter SASL/SCRAM credentials. Read more
Source§

fn create_delegation_token_with_options( &self, options: CreateDelegationTokenOptions, ) -> CreateDelegationTokenResult

Create a Delegation Token. Read more
Source§

fn renew_delegation_token_with_options( &self, hmac: &[u8], options: RenewDelegationTokenOptions, ) -> RenewDelegationTokenResult

Renew a Delegation Token. Read more
Source§

fn expire_delegation_token_with_options( &self, hmac: &[u8], options: ExpireDelegationTokenOptions, ) -> ExpireDelegationTokenResult

Expire a Delegation Token. Read more
Source§

fn describe_delegation_token_with_options( &self, options: DescribeDelegationTokenOptions, ) -> DescribeDelegationTokenResult

Describe the Delegation Tokens. Read more
Source§

fn describe_features_with_options( &self, options: DescribeFeaturesOptions, ) -> DescribeFeaturesResult

Describes finalized as well as supported features. The request is issued to any random broker. Read more
Source§

fn update_features_with_options( &self, feature_updates: &HashMap<String, FeatureUpdate>, options: UpdateFeaturesOptions, ) -> Result<UpdateFeaturesResult, Error>

Applies specified updates to finalized features. This operation is not transactional so some updates may succeed while the rest may fail. Read more
Source§

fn close_with_timeout<'life0, 'async_trait>( &'life0 self, timeout: Duration, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Close the Admin client and release all associated resources. Read more
Source§

fn create_topics(&self, new_topics: &[NewTopic]) -> CreateTopicsResult

Create a batch of new topics with the default options. Read more
Source§

fn delete_topics_with_string_slice( &self, topics: &[String], ) -> DeleteTopicsResult

This is a convenience method for Self::delete_topics_with_topic_collection_options with default options. See the overload for more details. Read more
Source§

fn delete_topics_with_string_slice_options( &self, topics: &[String], options: DeleteTopicsOptions, ) -> DeleteTopicsResult

This is a convenience method for Self::delete_topics_with_topic_collection_options with default options. See the overload for more details. Read more
Source§

fn delete_topics_with_topic_collection( &self, topics: TopicCollection, ) -> DeleteTopicsResult

This is a convenience method for Self::delete_topics_with_topic_collection_options with default options. See the overload for more details. Read more
Source§

fn list_topics(&self) -> ListTopicsResult

List the topics available in the cluster with the default options. Read more
Source§

fn describe_topics_with_topic_names( &self, topic_names: &[String], ) -> DescribeTopicsResult

Describe some topics in the cluster, with the default options. Read more
Source§

fn describe_topics_with_topic_names_options( &self, topic_names: &[String], options: DescribeTopicsOptions, ) -> DescribeTopicsResult

Describe some topics in the cluster. Read more
Source§

fn describe_topics_with_topics( &self, topics: TopicCollection, ) -> DescribeTopicsResult

This is a convenience method for Self::describe_topics_with_topics_options with default options. See the overload for more details. Read more
Source§

fn create_partitions( &self, new_partitions: &HashMap<String, NewPartitions>, ) -> CreatePartitionsResult

Increase the number of partitions of the topics given as the keys of new_partitions according to the corresponding values. If partitions are increased for a topic that has a key, the partition logic or ordering of the messages will be affected. Read more
Source§

fn delete_records( &self, records_to_delete: &HashMap<TopicPartition, RecordsToDelete>, ) -> DeleteRecordsResult

Delete records whose offset is smaller than the given offset of the corresponding partition. Read more
Source§

fn unregister_controller( &self, controller_id: i32, ) -> UnregisterControllerResult

Unregister a controller. This is a convenience method for Self::unregister_controller_with_options Read more
Source§

fn describe_producers( &self, partitions: &[TopicPartition], ) -> DescribeProducersResult

Describe producer state on a set of topic partitions. See Self::describe_producers_with_options for more details. Read more
Source§

fn abort_transaction( &self, spec: AbortTransactionSpec, ) -> AbortTransactionResult

Forcefully abort a transaction which is open on a topic partition. See Self::abort_transaction_with_options for more details. Read more
Source§

fn describe_transactions( &self, transactional_ids: &[String], ) -> DescribeTransactionsResult

Describe the state of a set of transactional IDs. See Self::describe_transactions_with_options for more details. Read more
Source§

fn fence_producers(&self, transactional_ids: &[String]) -> FenceProducersResult

Fence out all active producers that use any of the provided transactional IDs, with the default options. Read more
Source§

fn list_transactions(&self) -> ListTransactionsResult

List active transactions in the cluster. See Self::list_transactions_with_options for more details. Read more
Source§

fn force_terminate_transaction( &self, transactional_id: &str, ) -> TerminateTransactionResult

Force terminate a transaction for the given transactional ID with the default options. Read more
Source§

fn describe_cluster(&self) -> DescribeClusterResult

Get information about the nodes in the cluster, using the default options. Read more
Source§

fn describe_configs( &self, config_resources: &[ConfigResource], ) -> DescribeConfigsResult

Get the configuration for the specified resources with the default options. Read more
Source§

fn incremental_alter_configs( &self, configs: &HashMap<ConfigResource, Vec<AlterConfigOp>>, ) -> AlterConfigsResult

Incrementally updates the configuration for the specified resources with default options. Read more
Source§

fn list_config_resources(&self) -> ListConfigResourcesResult

List all configuration resources available in the cluster with the default options. Read more
Source§

fn describe_log_dirs(&self, brokers: &[i32]) -> DescribeLogDirsResult

Query the information of all log directories on the given set of brokers Read more
Source§

fn alter_replica_log_dirs( &self, replica_assignment: &HashMap<TopicPartitionReplica, String>, ) -> AlterReplicaLogDirsResult

Change the log directory for the specified replicas. If the replica does not exist on the broker, the result shows REPLICA_NOT_AVAILABLE for the given replica and the replica will be created in the given log directory on the broker when it is created later. If the replica already exists on the broker, the replica will be moved to the given log directory if it is not already there. For detailed result, inspect the returned AlterReplicaLogDirsResult instance. Read more
Source§

fn describe_replica_log_dirs( &self, replicas: &[TopicPartitionReplica], ) -> DescribeReplicaLogDirsResult

Query the replica log directory information for the specified replicas. Read more
Source§

fn elect_leaders( &self, election_type: ElectionType, partitions: Option<HashSet<TopicPartition>>, ) -> ElectLeadersResult

Elect a replica as leader for topic partitions. Read more
Source§

fn alter_partition_reassignments( &self, reassignments: &HashMap<TopicPartition, Option<NewPartitionReassignment>>, ) -> AlterPartitionReassignmentsResult

Change the reassignments for one or more partitions. Providing None will revert the reassignment for the associated partition. This is a convenience method for Self::alter_partition_reassignments_with_options with default options. See the overload for more details. Read more
Source§

fn list_partition_reassignments(&self) -> ListPartitionReassignmentsResult

List all of the current partition reassignments. Read more
Source§

fn list_partition_reassignments_with_partitions( &self, partitions: HashSet<TopicPartition>, ) -> ListPartitionReassignmentsResult

List the current reassignments for the given partitions. Read more
Source§

fn list_partition_reassignments_with_options( &self, options: ListPartitionReassignmentsOptions, ) -> ListPartitionReassignmentsResult

List all of the current partition reassignments. Read more
Source§

fn list_offsets( &self, topic_partition_offsets: &HashMap<TopicPartition, OffsetSpec>, ) -> ListOffsetsResult

List offset for the specified partitions and OffsetSpec. This operation enables to find the beginning offset, end offset as well as the offset matching a timestamp in partitions. Read more
Source§

fn list_groups(&self) -> ListGroupsResult

List the groups available in the cluster with the default options. Read more
Source§

fn describe_consumer_groups( &self, group_ids: &[String], ) -> DescribeConsumerGroupsResult

Describe some consumer groups in the cluster, with the default options. Read more
Source§

fn describe_classic_groups( &self, group_ids: &[String], ) -> DescribeClassicGroupsResult

Describe some classic groups in the cluster, with the default options. Read more
Source§

fn list_consumer_group_offsets_with_group_id( &self, group_id: &str, ) -> ListConsumerGroupOffsetsResult

List the consumer group offsets available in the cluster with the default options. Read more
Source§

fn list_consumer_group_offsets_with_group_id_options( &self, group_id: &str, options: ListConsumerGroupOffsetsOptions, ) -> ListConsumerGroupOffsetsResult

List the consumer group offsets available in the cluster. Read more
Source§

fn list_consumer_group_offsets_with_group_specs( &self, group_specs: &HashMap<String, ListConsumerGroupOffsetsSpec>, ) -> ListConsumerGroupOffsetsResult

List the consumer group offsets available in the cluster for the specified groups with the default options. Read more
Source§

fn alter_consumer_group_offsets( &self, group_id: &str, offsets: &HashMap<TopicPartition, OffsetAndMetadata>, ) -> AlterConsumerGroupOffsetsResult

Alters offsets for the specified group. In order to succeed, the group must be empty. Read more
Source§

fn delete_consumer_group_offsets( &self, group_id: &str, partitions: &HashSet<TopicPartition>, ) -> DeleteConsumerGroupOffsetsResult

Delete committed offsets for a set of partitions in a consumer group with the default options. This will succeed at the partition level only if the group is not actively subscribed to the corresponding topic. Read more
Source§

fn delete_consumer_groups( &self, group_ids: &[String], ) -> DeleteConsumerGroupsResult

Delete consumer groups from the cluster with the default options. Read more
Source§

fn create_acls(&self, acls: &[AclBinding]) -> CreateAclsResult

This is a convenience method for Self::create_acls_with_options with default options. See the overload for more details. Read more
Source§

fn describe_acls(&self, filter: &AclBindingFilter) -> DescribeAclsResult

This is a convenience method for Self::describe_acls_with_options with default options. See the overload for more details. Read more
Source§

fn delete_acls(&self, filters: &[AclBindingFilter]) -> DeleteAclsResult

This is a convenience method for Self::delete_acls_with_options with default options. See the overload for more details. Read more
Source§

fn describe_client_quotas( &self, filter: &ClientQuotaFilter, ) -> DescribeClientQuotasResult

Describes all entities matching the provided filter that have at least one client quota configuration value defined. Read more
Source§

fn alter_client_quotas( &self, entries: &[ClientQuotaAlteration], ) -> AlterClientQuotasResult

Alters client quota configurations with the specified alterations. Read more
Source§

fn describe_user_scram_credentials(&self) -> DescribeUserScramCredentialsResult

Describe all SASL/SCRAM credentials. Read more
Source§

fn describe_user_scram_credentials_with_users( &self, users: &[String], ) -> DescribeUserScramCredentialsResult

Describe SASL/SCRAM credentials for the given users. Read more
Source§

fn alter_user_scram_credentials( &self, alterations: &[UserScramCredentialAlteration], ) -> AlterUserScramCredentialsResult

Alter SASL/SCRAM credentials for the given users. Read more
Source§

fn create_delegation_token(&self) -> CreateDelegationTokenResult

Create a Delegation Token. Read more
Source§

fn renew_delegation_token(&self, hmac: &[u8]) -> RenewDelegationTokenResult

Renew a Delegation Token. Read more
Source§

fn expire_delegation_token(&self, hmac: &[u8]) -> ExpireDelegationTokenResult

Expire a Delegation Token. Read more
Source§

fn describe_delegation_token(&self) -> DescribeDelegationTokenResult

Describe the Delegation Tokens. Read more
Source§

fn describe_features(&self) -> DescribeFeaturesResult

Describes finalized as well as supported features. Read more
Source§

fn update_features( &self, feature_updates: &HashMap<String, FeatureUpdate>, ) -> Result<UpdateFeaturesResult, Error>

Applies specified updates to finalized features. Read more
Source§

fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Close the Admin and release all associated resources. Read more
Source§

impl Debug for KafkaAdminClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V