Skip to main content

AdminClientLike

Trait AdminClientLike 

Source
pub trait AdminClientLike: Send {
Show 26 methods // Required methods fn metadata<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, topics: &'life1 [&'life2 str], ) -> Pin<Box<dyn Future<Output = Result<TopicMetadata, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn reconcile_topic_replication_factor<'life0, 'life1, 'async_trait>( &'life0 mut self, topic: &'life1 str, replication_factor: i32, timeout: Time, ) -> Pin<Box<dyn Future<Output = Result<TopicReplicationStatus, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn create_topics<'life0, 'life1, 'async_trait>( &'life0 mut self, specs: &'life1 [CreateTopicSpec], options: TopicMutationOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<CreateTopicOutcome>, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_topics<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, names: &'life1 [&'life2 str], options: TopicMutationOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<DeleteTopicOutcome>, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn create_partitions<'life0, 'life1, 'async_trait>( &'life0 mut self, ops: &'life1 [CreatePartitionsOp], options: TopicMutationOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<CreatePartitionsOutcome>, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_records<'life0, 'life1, 'async_trait>( &'life0 mut self, ops: &'life1 [DeleteRecordsOp], timeout: Time, ) -> Pin<Box<dyn Future<Output = Result<Vec<DeleteRecordsOutcome>, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn describe_configs<'life0, 'life1, 'async_trait>( &'life0 mut self, resources: &'life1 [ConfigResource], options: DescribeConfigsOptions, ) -> Pin<Box<dyn Future<Output = Result<DescribeConfigsResults, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn incremental_alter_configs<'life0, 'life1, 'async_trait>( &'life0 mut self, configs: &'life1 BTreeMap<ConfigResource, Vec<AlterConfigOp>>, options: IncrementalAlterConfigsOptions, ) -> Pin<Box<dyn Future<Output = Result<AlterConfigsResults, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn alter_user_scram_credentials_sha512<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, upsertions: &'life1 [ScramUpsertion], deletions: &'life2 [ScramDeletion], ) -> Pin<Box<dyn Future<Output = Result<Vec<ScramUserOutcome>, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn alter_user_scram_credentials_sha256<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, upsertions: &'life1 [ScramUpsertion], deletions: &'life2 [ScramDeletion], ) -> Pin<Box<dyn Future<Output = Result<Vec<ScramUserOutcome>, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn describe_acls<'life0, 'life1, 'async_trait>( &'life0 mut self, filter: &'life1 AclEntryFilter, ) -> Pin<Box<dyn Future<Output = Result<Vec<AclEntry>, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn create_acls<'life0, 'life1, 'async_trait>( &'life0 mut self, creations: &'life1 [AclEntry], ) -> Pin<Box<dyn Future<Output = Result<Vec<CreateAclOutcome>, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_acls<'life0, 'life1, 'async_trait>( &'life0 mut self, filters: &'life1 [AclEntryFilter], ) -> Pin<Box<dyn Future<Output = Result<Vec<DeleteAclFilterOutcome>, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn describe_user_quotas<'life0, 'life1, 'async_trait>( &'life0 mut self, username: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<UserQuotaConfig, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn alter_user_quotas<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, username: &'life1 str, ops: &'life2 [QuotaOp], validate_only: bool, ) -> Pin<Box<dyn Future<Output = Result<Option<KafkaError>, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn create_delegation_token<'life0, 'life1, 'async_trait>( &'life0 mut self, options: &'life1 CreateDelegationTokenOptions, ) -> Pin<Box<dyn Future<Output = Result<DelegationToken, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn renew_delegation_token<'life0, 'life1, 'async_trait>( &'life0 mut self, hmac: &'life1 [u8], options: RenewDelegationTokenOptions, ) -> Pin<Box<dyn Future<Output = Result<i64, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn expire_delegation_token<'life0, 'life1, 'async_trait>( &'life0 mut self, hmac: &'life1 [u8], options: ExpireDelegationTokenOptions, ) -> Pin<Box<dyn Future<Output = Result<i64, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn describe_delegation_token<'life0, 'life1, 'async_trait>( &'life0 mut self, options: &'life1 DescribeDelegationTokenOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<DelegationToken>, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; // Provided methods fn update_metadata_version<'life0, 'async_trait>( &'life0 mut self, _level: i16, _upgrade_type: UpgradeType, _timeout: Time, ) -> Pin<Box<dyn Future<Output = Result<MetadataVersionUpdate, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn describe_metadata_quorum<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<MetadataQuorum, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn remove_raft_voter<'life0, 'life1, 'async_trait>( &'life0 mut self, _cluster_id: Option<&'life1 str>, _node_id: i32, _directory_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn describe_partition_assignments<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _topics: &'life1 [&'life2 str], ) -> Pin<Box<dyn Future<Output = Result<Vec<PartitionAssignment>, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn list_partition_reassignments<'life0, 'life1, 'async_trait>( &'life0 mut self, _partitions: &'life1 BTreeMap<String, Vec<i32>>, _timeout: Time, ) -> Pin<Box<dyn Future<Output = Result<Vec<PartitionAssignment>, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn alter_partition_assignments<'life0, 'life1, 'async_trait>( &'life0 mut self, _assignments: &'life1 BTreeMap<(String, i32), Option<Vec<i32>>>, _timeout: Time, ) -> Pin<Box<dyn Future<Output = Result<Vec<PartitionAssignmentOutcome>, AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn unregister_broker<'life0, 'async_trait>( &'life0 mut self, _broker_id: i32, ) -> Pin<Box<dyn Future<Output = Result<(), AdminError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... }
}
Expand description

Test seam for AdminClient.

The operator’s reconcile only needs dynamic dispatch through this trait. Production code wraps a concrete AdminClient, and tests substitute a fake.

Methods take &mut self because the underlying AdminClient’s NOT_CONTROLLER retry path reconnects the inner Connection in place, which needs unique access.

Required Methods§

Source

fn metadata<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, topics: &'life1 [&'life2 str], ) -> Pin<Box<dyn Future<Output = Result<TopicMetadata, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Metadata for the named topics. Pass an empty slice to fetch all topics, per Kafka semantics.

§Errors

Returns an error when configuration is invalid, protocol encoding fails, the broker rejects the request, or transport I/O fails.

Source

fn reconcile_topic_replication_factor<'life0, 'life1, 'async_trait>( &'life0 mut self, topic: &'life1 str, replication_factor: i32, timeout: Time, ) -> Pin<Box<dyn Future<Output = Result<TopicReplicationStatus, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Converges every partition of topic to replication_factor through AlterPartitionReassignments.

Existing replicas are retained where possible. Added replicas rotate across the broker list, and decreases preserve the leading replica order. An existing reassignment is never overwritten.

§Errors

Returns an error when the factor is invalid for the live broker set, metadata cannot be read, Kafka rejects a reassignment, or transport I/O fails.

Source

fn create_topics<'life0, 'life1, 'async_trait>( &'life0 mut self, specs: &'life1 [CreateTopicSpec], options: TopicMutationOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<CreateTopicOutcome>, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Creates topics through the active controller, as Kafka’s KafkaAdminClient.createTopics does.

The call retries until the deadline of options:

  • NOT_CONTROLLER (41) for any topic: find the controller again, wait for the backoff, and send every topic that has no outcome again (handleNotControllerError). With controller bootstrap, NOT_LEADER_OR_FOLLOWER (6) does the same.
  • THROTTLING_QUOTA_EXCEEDED (89): when TopicMutationOptions::retry_on_quota_violation is set, wait for the throttle time of the response and send only the throttled topics again. A topic that has an outcome is not sent again.

At the deadline a throttled topic keeps code 89, with the throttle time that remains. Another topic without an outcome gets REQUEST_TIMED_OUT (7). The outcomes keep the order of specs.

§Errors

Returns an error when configuration is invalid, protocol encoding fails, or transport I/O fails.

Source

fn delete_topics<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, names: &'life1 [&'life2 str], options: TopicMutationOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<DeleteTopicOutcome>, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Deletes topics through the active controller, as Kafka’s KafkaAdminClient.deleteTopics does. The call retries NOT_CONTROLLER (41) and THROTTLING_QUOTA_EXCEEDED (89) as AdminClientLike::create_topics does.

§Errors

Returns an error when configuration is invalid, protocol encoding fails, or transport I/O fails.

Source

fn create_partitions<'life0, 'life1, 'async_trait>( &'life0 mut self, ops: &'life1 [CreatePartitionsOp], options: TopicMutationOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<CreatePartitionsOutcome>, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Adds partitions through the active controller, as Kafka’s KafkaAdminClient.createPartitions does. The call retries NOT_CONTROLLER (41) and THROTTLING_QUOTA_EXCEEDED (89) as AdminClientLike::create_topics does.

§Errors

Returns an error when configuration is invalid, protocol encoding fails, or transport I/O fails.

Source

fn delete_records<'life0, 'life1, 'async_trait>( &'life0 mut self, ops: &'life1 [DeleteRecordsOp], timeout: Time, ) -> Pin<Box<dyn Future<Output = Result<Vec<DeleteRecordsOutcome>, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deletes records below each requested partition offset.

offset == -1 follows Kafka DeleteRecords semantics and truncates to the partition high watermark. The returned low_watermark is the broker’s resulting log-start offset for that partition.

§Errors

Returns an AdminError when metadata lookup, leader routing, transport, or protocol handling fails. Kafka partition-level failures remain in the returned DeleteRecordsOutcome::error_code.

Source

fn describe_configs<'life0, 'life1, 'async_trait>( &'life0 mut self, resources: &'life1 [ConfigResource], options: DescribeConfigsOptions, ) -> Pin<Box<dyn Future<Output = Result<DescribeConfigsResults, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Describes the configs of each resource of resources, as Kafka’s describeConfigs operation does.

The client sends one DescribeConfigs request to each broker that a BROKER resource with a broker id or a BROKER_LOGGER resource names, and one request with every other resource on its connection, all at the same time. Each request asks for every config of its resources. The result has one entry for each resource:

  • Its Config, or the error the broker gave for it, such as UNKNOWN_TOPIC_OR_PARTITION (3).
  • UNKNOWN_SERVER_ERROR (-1) when the answer has no result for it.
  • The error of its request when that request fails: REQUEST_TIMED_OUT (7) at default.api.timeout.ms (60 s), or UNSUPPORTED_VERSION (35) when the node does not support DescribeConfigs v3 and include_documentation is set. A broker is found by id in fresh metadata, and a missing broker or a lost connection is tried again until the deadline, as in AdminClient::describe_log_dirs.
§Errors

Returns AdminError::InvalidArgument, and sends nothing, when the name of a BROKER resource is neither empty nor a broker id, or the name of a BROKER_LOGGER resource is not a broker id, as Kafka’s nodeFor throws a NumberFormatException.

Source

fn incremental_alter_configs<'life0, 'life1, 'async_trait>( &'life0 mut self, configs: &'life1 BTreeMap<ConfigResource, Vec<AlterConfigOp>>, options: IncrementalAlterConfigsOptions, ) -> Pin<Box<dyn Future<Output = Result<AlterConfigsResults, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Changes the configs of each resource of configs, as Kafka’s incrementalAlterConfigs operation does. With IncrementalAlterConfigsOptions::validate_only the broker validates the changes and applies none.

A BROKER resource with a broker id goes to that broker, and a BROKER_LOGGER resource to its broker, each in a request of its own. With a controller bootstrap only a BROKER_LOGGER resource goes to its node. Every other resource goes in one request on the client’s connection. A NOT_CONTROLLER (41) answer, or with a controller bootstrap a NOT_LEADER_OR_FOLLOWER (6) answer, makes the client find the controller again and send the request again until the deadline. The result has one entry for each resource:

  • Ok(()), or the error the broker gave for it, such as INVALID_CONFIG (40).
  • UNKNOWN_SERVER_ERROR (-1) when the answer has no result for it.
  • The error of its request when that request fails, with REQUEST_TIMED_OUT (7) at default.api.timeout.ms (60 s).
§Errors

Returns AdminError::InvalidArgument, and sends nothing, for a resource name that Self::describe_configs refuses.

Source

fn alter_user_scram_credentials_sha512<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, upsertions: &'life1 [ScramUpsertion], deletions: &'life2 [ScramDeletion], ) -> Pin<Box<dyn Future<Output = Result<Vec<ScramUserOutcome>, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Upserts SCRAM-SHA-512 credentials, deletes them, or both, in a single call.

upsertions carry plaintext passwords. The function generates a fresh 16-byte salt per row and computes the KIP-554 wire salted_password (PBKDF2-HMAC-SHA-512) client-side with krabka_security::pbkdf2_salted. The broker never sees the raw password.

§Errors

Returns an error when configuration is invalid, protocol encoding fails, the broker rejects the request, or transport I/O fails.

Source

fn alter_user_scram_credentials_sha256<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, upsertions: &'life1 [ScramUpsertion], deletions: &'life2 [ScramDeletion], ) -> Pin<Box<dyn Future<Output = Result<Vec<ScramUserOutcome>, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

SCRAM-SHA-256 sibling of Self::alter_user_scram_credentials_sha512.

The iteration counts, the salt generation, and the salted-password derivation are identical to the SHA-512 path. Only the mechanism wire byte and the HMAC algorithm differ.

§Errors

Same as _sha512: returns AdminError::Protocol when the system RNG fails, otherwise propagates the broker’s per-username outcome rows.

Source

fn describe_acls<'life0, 'life1, 'async_trait>( &'life0 mut self, filter: &'life1 AclEntryFilter, ) -> Pin<Box<dyn Future<Output = Result<Vec<AclEntry>, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Lists ACLs that match filter.

The broker’s response is resource-grouped on the wire, with one block per (resource_type, resource_name, pattern_type). This method flattens it back into AclEntry rows for the diff.

§Errors

Returns an error when configuration is invalid, protocol encoding fails, the broker rejects the request, or transport I/O fails.

Source

fn create_acls<'life0, 'life1, 'async_trait>( &'life0 mut self, creations: &'life1 [AclEntry], ) -> Pin<Box<dyn Future<Output = Result<Vec<CreateAclOutcome>, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Creates the supplied ACLs.

§Errors

Returns AdminError::InvalidArgument, before anything is sent, for an entry whose pattern type is PatternType::Match: Kafka’s ResourcePattern refuses patternType must not be MATCH. Otherwise returns an error when protocol encoding fails, the broker rejects the request, or transport I/O fails.

Source

fn delete_acls<'life0, 'life1, 'async_trait>( &'life0 mut self, filters: &'life1 [AclEntryFilter], ) -> Pin<Box<dyn Future<Output = Result<Vec<DeleteAclFilterOutcome>, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deletes every ACL that matches any of filters.

Each filter’s response surfaces the matched ACL set, so callers can confirm that the deletion converged on the expected rows.

§Errors

Returns an error when configuration is invalid, protocol encoding fails, the broker rejects the request, or transport I/O fails.

Source

fn describe_user_quotas<'life0, 'life1, 'async_trait>( &'life0 mut self, username: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<UserQuotaConfig, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Reads the quotas of the user entity {user: username}.

The filter is strict on the single component ("user", username), as ClientQuotaFilter.containsOnly: an entry whose entity also has a client-id does not match.

§Errors

See AdminClient::describe_client_quotas.

Source

fn alter_user_quotas<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, username: &'life1 str, ops: &'life2 [QuotaOp], validate_only: bool, ) -> Pin<Box<dyn Future<Output = Result<Option<KafkaError>, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Applies ops to the user entity {user: username}. Returns the error the broker gave for the entity, or None on success. No request is sent for an empty ops.

§Errors

See AdminClient::alter_client_quotas.

Source

fn create_delegation_token<'life0, 'life1, 'async_trait>( &'life0 mut self, options: &'life1 CreateDelegationTokenOptions, ) -> Pin<Box<dyn Future<Output = Result<DelegationToken, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Creates a delegation token, as Kafka’s createDelegationToken operation does.

The broker does not return the renewers, so the result has the renewers of options, as Kafka’s result does. With an owner the client negotiates CreateDelegationToken v3 or higher, as Kafka’s request refuses to write the owner fields below v3.

§Errors

Returns AdminError::Broker for a non-zero error code, such as DELEGATION_TOKEN_AUTH_DISABLED (61), DELEGATION_TOKEN_REQUEST_NOT_ALLOWED (64), DELEGATION_TOKEN_AUTHORIZATION_FAILED (65), or INVALID_PRINCIPAL_TYPE (67). Returns AdminError::Transport when the connection fails, or when an owner is set and the broker does not support v3.

Source

fn renew_delegation_token<'life0, 'life1, 'async_trait>( &'life0 mut self, hmac: &'life1 [u8], options: RenewDelegationTokenOptions, ) -> Pin<Box<dyn Future<Output = Result<i64, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Renews the delegation token with hmac, as Kafka’s renewDelegationToken operation does, and returns its new expiry in epoch milliseconds.

§Errors

Returns AdminError::Broker for a non-zero error code, such as DELEGATION_TOKEN_NOT_FOUND (62), DELEGATION_TOKEN_OWNER_MISMATCH (63), or DELEGATION_TOKEN_EXPIRED (66). Returns AdminError::Transport when the connection fails.

Source

fn expire_delegation_token<'life0, 'life1, 'async_trait>( &'life0 mut self, hmac: &'life1 [u8], options: ExpireDelegationTokenOptions, ) -> Pin<Box<dyn Future<Output = Result<i64, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Expires the delegation token with hmac, as Kafka’s expireDelegationToken operation does, and returns the expiry that the broker set, in epoch milliseconds. A token that expires now gets the broker’s clock at the time of the request.

§Errors

Returns AdminError::Broker for a non-zero error code, such as DELEGATION_TOKEN_NOT_FOUND (62), DELEGATION_TOKEN_OWNER_MISMATCH (63), or DELEGATION_TOKEN_EXPIRED (66). Returns AdminError::Transport when the connection fails.

Source

fn describe_delegation_token<'life0, 'life1, 'async_trait>( &'life0 mut self, options: &'life1 DescribeDelegationTokenOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<DelegationToken>, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Describes the delegation tokens that options selects, as Kafka’s describeDelegationToken operation does.

§Errors

Returns AdminError::Broker for a non-zero error code, such as DELEGATION_TOKEN_AUTH_DISABLED (61) or DELEGATION_TOKEN_REQUEST_NOT_ALLOWED (64). Returns AdminError::Transport when the connection fails.

Provided Methods§

Source

fn update_metadata_version<'life0, 'async_trait>( &'life0 mut self, _level: i16, _upgrade_type: UpgradeType, _timeout: Time, ) -> Pin<Box<dyn Future<Output = Result<MetadataVersionUpdate, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Finalize metadata.version at level through UpdateFeatures.

§Errors

Returns a transport, protocol, or broker error when Kafka rejects the requested level.

Source

fn describe_metadata_quorum<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<MetadataQuorum, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the live __cluster_metadata partition-zero quorum view.

§Errors

Returns a transport, protocol, or Kafka error from DescribeQuorum.

Source

fn remove_raft_voter<'life0, 'life1, 'async_trait>( &'life0 mut self, _cluster_id: Option<&'life1 str>, _node_id: i32, _directory_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove one exact node and directory identity from the metadata quorum, as Kafka’s removeRaftVoter operation does.

cluster_id is Kafka’s RemoveRaftVoterOptions.clusterId, the cluster ID string as meta.properties holds it; None sends a null cluster ID, which the controller does not check.

NOT_CONTROLLER (41) makes the client find the controller again and resend the request with the backoff until default.api.timeout.ms (60 s), as Kafka’s handleNotControllerError does.

§Errors

Returns a transport, protocol, or Kafka error from RemoveRaftVoter, and REQUEST_TIMED_OUT (7) at the deadline.

Source

fn describe_partition_assignments<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _topics: &'life1 [&'life2 str], ) -> Pin<Box<dyn Future<Output = Result<Vec<PartitionAssignment>, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Returns current replica membership for every selected partition.

Pass an empty topic slice to inspect the whole cluster before broker evacuation.

§Errors

Returns a transport or protocol error.

Source

fn list_partition_reassignments<'life0, 'life1, 'async_trait>( &'life0 mut self, _partitions: &'life1 BTreeMap<String, Vec<i32>>, _timeout: Time, ) -> Pin<Box<dyn Future<Output = Result<Vec<PartitionAssignment>, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Lists active partition reassignments and their replica membership.

An empty filter lists every active reassignment.

§Errors

Returns a transport, protocol, or top-level broker error.

Source

fn alter_partition_assignments<'life0, 'life1, 'async_trait>( &'life0 mut self, _assignments: &'life1 BTreeMap<(String, i32), Option<Vec<i32>>>, _timeout: Time, ) -> Pin<Box<dyn Future<Output = Result<Vec<PartitionAssignmentOutcome>, AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Submits exact replica lists; None cancels an active reassignment. A reassignment may change a partition’s replication factor, Kafka’s default; AdminClient::alter_partition_assignments_with can refuse that.

§Errors

Returns a transport, protocol, or top-level broker error.

Source

fn unregister_broker<'life0, 'async_trait>( &'life0 mut self, _broker_id: i32, ) -> Pin<Box<dyn Future<Output = Result<(), AdminError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Unregisters one broker from the active KRaft controller.

Kafka’s KafkaAdminClient.unregisterBroker retries REQUEST_TIMED_OUT (7) with the retry backoff until the call deadline (default.api.timeout.ms, 60 s), and fails at once on every other code, NOT_CONTROLLER (41) too. This call does the same.

§Errors

Returns a transport, protocol, or broker error. At the deadline it gives REQUEST_TIMED_OUT (7).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§