Class ForwardingAdmin
- All Implemented Interfaces:
- AutoCloseable,- Admin
ForwardingAdmin is the default value of forwarding.admin.class in MirrorMaker.
 Users who wish to customize the MirrorMaker behaviour for the creation of topics and access control lists can extend this
 class without needing to provide a whole implementation of Admin.
 The class must have a constructor with signature (Map<String, Object> config) for configuring
 a decorated KafkaAdminClient and any other clients needed for external resource management.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabortTransaction(AbortTransactionSpec spec, AbortTransactionOptions options) Forcefully abort a transaction which is open on a topic partition.alterClientQuotas(Collection<ClientQuotaAlteration> entries, AlterClientQuotasOptions options) Alters client quota configurations with the specified alterations.alterConfigs(Map<ConfigResource, Config> configs, AlterConfigsOptions options) Deprecated.alterConsumerGroupOffsets(String groupId, Map<TopicPartition, OffsetAndMetadata> offsets, AlterConsumerGroupOffsetsOptions options) Alters offsets for the specified group.alterPartitionReassignments(Map<TopicPartition, Optional<NewPartitionReassignment>> reassignments, AlterPartitionReassignmentsOptions options) Change the reassignments for one or more partitions.alterReplicaLogDirs(Map<TopicPartitionReplica, String> replicaAssignment, AlterReplicaLogDirsOptions options) Change the log directory for the specified replicas.alterUserScramCredentials(List<UserScramCredentialAlteration> alterations, AlterUserScramCredentialsOptions options) Alter SASL/SCRAM credentials.clientInstanceId(Duration timeout) Determines the client's unique client instance ID used for telemetry.voidClose the Admin client and release all associated resources.createAcls(Collection<AclBinding> acls, CreateAclsOptions options) Creates access control lists (ACLs) which are bound to specific resources.Create a Delegation Token.createPartitions(Map<String, NewPartitions> newPartitions, CreatePartitionsOptions options) Increase the number of partitions of the topics given as the keys ofnewPartitionsaccording to the corresponding values.createTopics(Collection<NewTopic> newTopics, CreateTopicsOptions options) Create a batch of new topics.deleteAcls(Collection<AclBindingFilter> filters, DeleteAclsOptions options) Deletes access control lists (ACLs) according to the supplied filters.deleteConsumerGroupOffsets(String groupId, Set<TopicPartition> partitions, DeleteConsumerGroupOffsetsOptions options) Delete committed offsets for a set of partitions in a consumer group.deleteConsumerGroups(Collection<String> groupIds, DeleteConsumerGroupsOptions options) Delete consumer groups from the cluster.deleteRecords(Map<TopicPartition, RecordsToDelete> recordsToDelete, DeleteRecordsOptions options) Delete records whose offset is smaller than the given offset of the corresponding partition.deleteTopics(TopicCollection topics, DeleteTopicsOptions options) Delete a batch of topics.describeAcls(AclBindingFilter filter, DescribeAclsOptions options) Lists access control lists (ACLs) according to the supplied filter.describeClientQuotas(ClientQuotaFilter filter, DescribeClientQuotasOptions options) Describes all entities matching the provided filter that have at least one client quota configuration value defined.describeCluster(DescribeClusterOptions options) Get information about the nodes in the cluster.describeConfigs(Collection<ConfigResource> resources, DescribeConfigsOptions options) Get the configuration for the specified resources.describeConsumerGroups(Collection<String> groupIds, DescribeConsumerGroupsOptions options) Describe some group IDs in the cluster.Describe the Delegation Tokens.describeFeatures(DescribeFeaturesOptions options) Describes finalized as well as supported features.describeLogDirs(Collection<Integer> brokers, DescribeLogDirsOptions options) Query the information of all log directories on the given set of brokersDescribes the state of the metadata quorum.describeProducers(Collection<TopicPartition> partitions, DescribeProducersOptions options) Describe active producer state on a set of topic partitions.describeReplicaLogDirs(Collection<TopicPartitionReplica> replicas, DescribeReplicaLogDirsOptions options) Query the replica log directory information for the specified replicas.describeTopics(TopicCollection topics, DescribeTopicsOptions options) Describe some topics in the cluster.describeTransactions(Collection<String> transactionalIds, DescribeTransactionsOptions options) Describe the state of a set of transactional IDs from the respective transaction coordinators, which are dynamically discovered.describeUserScramCredentials(List<String> users, DescribeUserScramCredentialsOptions options) Describe SASL/SCRAM credentials.electLeaders(ElectionType electionType, Set<TopicPartition> partitions, ElectLeadersOptions options) Elect a replica as leader for the givenpartitions, or for all partitions if the argument topartitionsis null.expireDelegationToken(byte[] hmac, ExpireDelegationTokenOptions options) Expire a Delegation Token.fenceProducers(Collection<String> transactionalIds, FenceProducersOptions options) Fence out all active producers that use any of the provided transactional IDs.incrementalAlterConfigs(Map<ConfigResource, Collection<AlterConfigOp>> configs, AlterConfigsOptions options) Incrementally update the configuration for the specified resources.List the client metrics configuration resources available in the cluster.listConsumerGroupOffsets(Map<String, ListConsumerGroupOffsetsSpec> groupSpecs, ListConsumerGroupOffsetsOptions options) List the consumer group offsets available in the cluster for the specified consumer groups.List the consumer groups available in the cluster.listOffsets(Map<TopicPartition, OffsetSpec> topicPartitionOffsets, ListOffsetsOptions options) List offset for the specified partitions.listPartitionReassignments(Optional<Set<TopicPartition>> partitions, ListPartitionReassignmentsOptions options) listTopics(ListTopicsOptions options) List the topics available in the cluster.listTransactions(ListTransactionsOptions options) List active transactions in the cluster.Map<MetricName,? extends Metric> metrics()Get the metrics kept by the adminClientremoveMembersFromConsumerGroup(String groupId, RemoveMembersFromConsumerGroupOptions options) Remove members from the consumer group by given member identities.renewDelegationToken(byte[] hmac, RenewDelegationTokenOptions options) Renew a Delegation Token.unregisterBroker(int brokerId, UnregisterBrokerOptions options) Unregister a broker.updateFeatures(Map<String, FeatureUpdate> featureUpdates, UpdateFeaturesOptions options) Applies specified updates to finalized features.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.kafka.clients.admin.AdminabortTransaction, alterClientQuotas, alterConfigs, alterConsumerGroupOffsets, alterPartitionReassignments, alterReplicaLogDirs, alterUserScramCredentials, close, createAcls, createDelegationToken, createPartitions, createTopics, deleteAcls, deleteConsumerGroupOffsets, deleteConsumerGroups, deleteRecords, deleteTopics, deleteTopics, deleteTopics, describeAcls, describeClientQuotas, describeCluster, describeConfigs, describeConsumerGroups, describeDelegationToken, describeFeatures, describeLogDirs, describeMetadataQuorum, describeProducers, describeReplicaLogDirs, describeTopics, describeTopics, describeTopics, describeTransactions, describeUserScramCredentials, describeUserScramCredentials, electLeaders, expireDelegationToken, fenceProducers, incrementalAlterConfigs, listClientMetricsResources, listConsumerGroupOffsets, listConsumerGroupOffsets, listConsumerGroupOffsets, listConsumerGroups, listOffsets, listPartitionReassignments, listPartitionReassignments, listPartitionReassignments, listPartitionReassignments, listTopics, listTransactions, renewDelegationToken, unregisterBroker
- 
Constructor Details- 
ForwardingAdmin
 
- 
- 
Method Details- 
closeDescription copied from interface:AdminClose the Admin client and release all associated resources.The close operation has a grace period during which current operations will be allowed to complete, specified by the given duration. New operations will not be accepted during the grace period. Once the grace period is over, all operations that have not yet been completed will be aborted with a TimeoutException.
- 
createTopicsDescription copied from interface:AdminCreate a batch of new topics.This operation is not transactional so it may succeed for some topics while fail for others. It may take several seconds after CreateTopicsResultreturns success for all the brokers to become aware that the topics have been created. During this time,Admin.listTopics()andAdmin.describeTopics(Collection)may not return information about the new topics.This operation is supported by brokers with version 0.10.1.0 or higher. The validateOnly option is supported from version 0.10.2.0. - Specified by:
- createTopicsin interface- Admin
- Parameters:
- newTopics- The new topics to create.
- options- The options to use when creating the new topics.
- Returns:
- The CreateTopicsResult.
 
- 
deleteTopicsDescription copied from interface:AdminDelete a batch of topics.This operation is not transactional so it may succeed for some topics while fail for others. It may take several seconds after the DeleteTopicsResultreturns success for all the brokers to become aware that the topics are gone. During this time,Admin.listTopics()andAdmin.describeTopics(Collection)may continue to return information about the deleted topics.If delete.topic.enable is false on the brokers, deleteTopics will mark the topics for deletion, but not actually delete them. The futures will return successfully in this case. When using topic IDs, this operation is supported by brokers with inter-broker protocol 2.8 or higher. When using topic names, this operation is supported by brokers with version 0.10.1.0 or higher. - Specified by:
- deleteTopicsin interface- Admin
- Parameters:
- topics- The topics to delete.
- options- The options to use when deleting the topics.
- Returns:
- The DeleteTopicsResult.
 
- 
listTopicsDescription copied from interface:AdminList the topics available in the cluster.- Specified by:
- listTopicsin interface- Admin
- Parameters:
- options- The options to use when listing the topics.
- Returns:
- The ListTopicsResult.
 
- 
describeTopicsDescription copied from interface:AdminDescribe some topics in the cluster. When using topic IDs, this operation is supported by brokers with version 3.1.0 or higher.- Specified by:
- describeTopicsin interface- Admin
- Parameters:
- topics- The topics to describe.
- options- The options to use when describing the topics.
- Returns:
- The DescribeTopicsResult.
 
- 
describeClusterDescription copied from interface:AdminGet information about the nodes in the cluster.- Specified by:
- describeClusterin interface- Admin
- Parameters:
- options- The options to use when getting information about the cluster.
- Returns:
- The DescribeClusterResult.
 
- 
describeAclsDescription copied from interface:AdminLists access control lists (ACLs) according to the supplied filter.Note: it may take some time for changes made by createAclsordeleteAclsto be reflected in the output ofdescribeAcls.This operation is supported by brokers with version 0.11.0.0 or higher. - Specified by:
- describeAclsin interface- Admin
- Parameters:
- filter- The filter to use.
- options- The options to use when listing the ACLs.
- Returns:
- The DescribeAclsResult.
 
- 
createAclsDescription copied from interface:AdminCreates access control lists (ACLs) which are bound to specific resources.This operation is not transactional so it may succeed for some ACLs while fail for others. If you attempt to add an ACL that duplicates an existing ACL, no error will be raised, but no changes will be made. This operation is supported by brokers with version 0.11.0.0 or higher. - Specified by:
- createAclsin interface- Admin
- Parameters:
- acls- The ACLs to create
- options- The options to use when creating the ACLs.
- Returns:
- The CreateAclsResult.
 
- 
deleteAclsDescription copied from interface:AdminDeletes access control lists (ACLs) according to the supplied filters.This operation is not transactional so it may succeed for some ACLs while fail for others. This operation is supported by brokers with version 0.11.0.0 or higher. - Specified by:
- deleteAclsin interface- Admin
- Parameters:
- filters- The filters to use.
- options- The options to use when deleting the ACLs.
- Returns:
- The DeleteAclsResult.
 
- 
describeConfigspublic DescribeConfigsResult describeConfigs(Collection<ConfigResource> resources, DescribeConfigsOptions options) Description copied from interface:AdminGet the configuration for the specified resources.The returned configuration includes default values and the isDefault() method can be used to distinguish them from user supplied values. The value of config entries where isSensitive() is true is always nullso that sensitive information is not disclosed.Config entries where isReadOnly() is true cannot be updated. This operation is supported by brokers with version 0.11.0.0 or higher. - Specified by:
- describeConfigsin interface- Admin
- Parameters:
- resources- The resources (topic and broker resource types are currently supported)
- options- The options to use when describing configs
- Returns:
- The DescribeConfigsResult
 
- 
alterConfigs@Deprecated public AlterConfigsResult alterConfigs(Map<ConfigResource, Config> configs, AlterConfigsOptions options) Deprecated.Description copied from interface:AdminUpdate the configuration for the specified resources with the default options.Updates are not transactional so they may succeed for some resources while fail for others. The configs for a particular resource are updated atomically. This operation is supported by brokers with version 0.11.0.0 or higher. - Specified by:
- alterConfigsin interface- Admin
- Parameters:
- configs- The resources with their configs (topic is the only resource type with configs that can be updated currently)
- options- The options to use when describing configs
- Returns:
- The AlterConfigsResult
 
- 
incrementalAlterConfigspublic AlterConfigsResult incrementalAlterConfigs(Map<ConfigResource, Collection<AlterConfigOp>> configs, AlterConfigsOptions options) Description copied from interface:AdminIncrementally update the configuration for the specified resources.Updates are not transactional so they may succeed for some resources while fail for others. The configs for a particular resource are updated atomically. The following exceptions can be anticipated when calling get()on the futures obtained from the returnedAlterConfigsResult:- ClusterAuthorizationExceptionif the authenticated user didn't have alter access to the cluster.
- TopicAuthorizationExceptionif the authenticated user didn't have alter access to the Topic.
- UnknownTopicOrPartitionExceptionif the Topic doesn't exist.
- InvalidRequestExceptionif the request details are invalid. e.g., a configuration key was specified more than once for a resource
 This operation is supported by brokers with version 2.3.0 or higher. - Specified by:
- incrementalAlterConfigsin interface- Admin
- Parameters:
- configs- The resources with their configs
- options- The options to use when altering configs
- Returns:
- The AlterConfigsResult
 
- 
alterReplicaLogDirspublic AlterReplicaLogDirsResult alterReplicaLogDirs(Map<TopicPartitionReplica, String> replicaAssignment, AlterReplicaLogDirsOptions options) Description copied from interface:AdminChange 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 returnedAlterReplicaLogDirsResultinstance.This operation is not transactional so it may succeed for some replicas while fail for others. This operation is supported by brokers with version 1.1.0 or higher. - Specified by:
- alterReplicaLogDirsin interface- Admin
- Parameters:
- replicaAssignment- The replicas with their log directory absolute path
- options- The options to use when changing replica dir
- Returns:
- The AlterReplicaLogDirsResult
 
- 
describeLogDirspublic DescribeLogDirsResult describeLogDirs(Collection<Integer> brokers, DescribeLogDirsOptions options) Description copied from interface:AdminQuery the information of all log directories on the given set of brokersThis operation is supported by brokers with version 1.0.0 or higher. - Specified by:
- describeLogDirsin interface- Admin
- Parameters:
- brokers- A list of brokers
- options- The options to use when querying log dir info
- Returns:
- The DescribeLogDirsResult
 
- 
describeReplicaLogDirspublic DescribeReplicaLogDirsResult describeReplicaLogDirs(Collection<TopicPartitionReplica> replicas, DescribeReplicaLogDirsOptions options) Description copied from interface:AdminQuery the replica log directory information for the specified replicas.This operation is supported by brokers with version 1.0.0 or higher. - Specified by:
- describeReplicaLogDirsin interface- Admin
- Parameters:
- replicas- The replicas to query
- options- The options to use when querying replica log dir info
- Returns:
- The DescribeReplicaLogDirsResult
 
- 
createPartitionspublic CreatePartitionsResult createPartitions(Map<String, NewPartitions> newPartitions, CreatePartitionsOptions options) Description copied from interface:AdminIncrease the number of partitions of the topics given as the keys ofnewPartitionsaccording 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.This operation is not transactional so it may succeed for some topics while fail for others. It may take several seconds after this method returns success for all the brokers to become aware that the partitions have been created. During this time, Admin.describeTopics(Collection)may not return information about the new partitions.This operation is supported by brokers with version 1.0.0 or higher. The following exceptions can be anticipated when calling get()on the futures obtained from thevalues()method of the returnedCreatePartitionsResult- AuthorizationExceptionif the authenticated user is not authorized to alter the topic
- TimeoutExceptionif the request was not completed in within the given- AbstractOptions.timeoutMs().
- ReassignmentInProgressExceptionif a partition reassignment is currently in progress
- BrokerNotAvailableExceptionif the requested- NewPartitions.assignments()contain a broker that is currently unavailable.
- InvalidReplicationFactorExceptionif no- NewPartitions.assignments()are given and it is impossible for the broker to assign replicas with the topics replication factor.
- Subclasses of KafkaExceptionif the request is invalid in some way.
 - Specified by:
- createPartitionsin interface- Admin
- Parameters:
- newPartitions- The topics which should have new partitions created, and corresponding parameters for the created partitions.
- options- The options to use when creating the new partitions.
- Returns:
- The CreatePartitionsResult.
 
- 
deleteRecordspublic DeleteRecordsResult deleteRecords(Map<TopicPartition, RecordsToDelete> recordsToDelete, DeleteRecordsOptions options) Description copied from interface:AdminDelete records whose offset is smaller than the given offset of the corresponding partition.This operation is supported by brokers with version 0.11.0.0 or higher. - Specified by:
- deleteRecordsin interface- Admin
- Parameters:
- recordsToDelete- The topic partitions and related offsets from which records deletion starts.
- options- The options to use when deleting records.
- Returns:
- The DeleteRecordsResult.
 
- 
createDelegationTokenDescription copied from interface:AdminCreate a Delegation Token.This operation is supported by brokers with version 1.1.0 or higher. The following exceptions can be anticipated when calling get()on the futures obtained from thedelegationToken()method of the returnedCreateDelegationTokenResult- UnsupportedByAuthenticationExceptionIf the request sent on PLAINTEXT/1-way SSL channels or delegation token authenticated channels.
- InvalidPrincipalTypeExceptionif the renewers principal type is not supported.
- DelegationTokenDisabledExceptionif the delegation token feature is disabled.
- TimeoutExceptionif the request was not completed in within the given- AbstractOptions.timeoutMs().
 - Specified by:
- createDelegationTokenin interface- Admin
- Parameters:
- options- The options to use when creating delegation token.
- Returns:
- The CreateDelegationTokenResult.
 
- 
renewDelegationTokenpublic RenewDelegationTokenResult renewDelegationToken(byte[] hmac, RenewDelegationTokenOptions options) Description copied from interface:AdminRenew a Delegation Token.This operation is supported by brokers with version 1.1.0 or higher. The following exceptions can be anticipated when calling get()on the futures obtained from theexpiryTimestamp()method of the returnedRenewDelegationTokenResult- UnsupportedByAuthenticationExceptionIf the request sent on PLAINTEXT/1-way SSL channels or delegation token authenticated channels.
- DelegationTokenDisabledExceptionif the delegation token feature is disabled.
- DelegationTokenNotFoundExceptionif the delegation token is not found on server.
- DelegationTokenOwnerMismatchExceptionif the authenticated user is not owner/renewer of the token.
- DelegationTokenExpiredExceptionif the delegation token is expired.
- TimeoutExceptionif the request was not completed in within the given- AbstractOptions.timeoutMs().
 - Specified by:
- renewDelegationTokenin interface- Admin
- Parameters:
- hmac- HMAC of the Delegation token
- options- The options to use when renewing delegation token.
- Returns:
- The RenewDelegationTokenResult.
 
- 
expireDelegationTokenpublic ExpireDelegationTokenResult expireDelegationToken(byte[] hmac, ExpireDelegationTokenOptions options) Description copied from interface:AdminExpire a Delegation Token.This operation is supported by brokers with version 1.1.0 or higher. The following exceptions can be anticipated when calling get()on the futures obtained from theexpiryTimestamp()method of the returnedExpireDelegationTokenResult- UnsupportedByAuthenticationExceptionIf the request sent on PLAINTEXT/1-way SSL channels or delegation token authenticated channels.
- DelegationTokenDisabledExceptionif the delegation token feature is disabled.
- DelegationTokenNotFoundExceptionif the delegation token is not found on server.
- DelegationTokenOwnerMismatchExceptionif the authenticated user is not owner/renewer of the requested token.
- DelegationTokenExpiredExceptionif the delegation token is expired.
- TimeoutExceptionif the request was not completed in within the given- AbstractOptions.timeoutMs().
 - Specified by:
- expireDelegationTokenin interface- Admin
- Parameters:
- hmac- HMAC of the Delegation token
- options- The options to use when expiring delegation token.
- Returns:
- The ExpireDelegationTokenResult.
 
- 
describeDelegationTokenpublic DescribeDelegationTokenResult describeDelegationToken(DescribeDelegationTokenOptions options) Description copied from interface:AdminDescribe the Delegation Tokens.This operation is supported by brokers with version 1.1.0 or higher. The following exceptions can be anticipated when calling get()on the futures obtained from thedelegationTokens()method of the returnedDescribeDelegationTokenResult- UnsupportedByAuthenticationExceptionIf the request sent on PLAINTEXT/1-way SSL channels or delegation token authenticated channels.
- DelegationTokenDisabledExceptionif the delegation token feature is disabled.
- TimeoutExceptionif the request was not completed in within the given- AbstractOptions.timeoutMs().
 - Specified by:
- describeDelegationTokenin interface- Admin
- Parameters:
- options- The options to use when describing delegation tokens.
- Returns:
- The DescribeDelegationTokenResult.
 
- 
describeConsumerGroupspublic DescribeConsumerGroupsResult describeConsumerGroups(Collection<String> groupIds, DescribeConsumerGroupsOptions options) Description copied from interface:AdminDescribe some group IDs in the cluster.- Specified by:
- describeConsumerGroupsin interface- Admin
- Parameters:
- groupIds- The IDs of the groups to describe.
- options- The options to use when describing the groups.
- Returns:
- The DescribeConsumerGroupResult.
 
- 
listConsumerGroupsDescription copied from interface:AdminList the consumer groups available in the cluster.- Specified by:
- listConsumerGroupsin interface- Admin
- Parameters:
- options- The options to use when listing the consumer groups.
- Returns:
- The ListConsumerGroupsResult.
 
- 
listConsumerGroupOffsetspublic ListConsumerGroupOffsetsResult listConsumerGroupOffsets(Map<String, ListConsumerGroupOffsetsSpec> groupSpecs, ListConsumerGroupOffsetsOptions options) Description copied from interface:AdminList the consumer group offsets available in the cluster for the specified consumer groups.- Specified by:
- listConsumerGroupOffsetsin interface- Admin
- Parameters:
- groupSpecs- Map of consumer group ids to a spec that specifies the topic partitions of the group to list offsets for.
- options- The options to use when listing the consumer group offsets.
- Returns:
- The ListConsumerGroupOffsetsResult
 
- 
deleteConsumerGroupspublic DeleteConsumerGroupsResult deleteConsumerGroups(Collection<String> groupIds, DeleteConsumerGroupsOptions options) Description copied from interface:AdminDelete consumer groups from the cluster.- Specified by:
- deleteConsumerGroupsin interface- Admin
- options- The options to use when deleting a consumer group.
- Returns:
- The DeleteConsumerGroupsResult.
 
- 
deleteConsumerGroupOffsetspublic DeleteConsumerGroupOffsetsResult deleteConsumerGroupOffsets(String groupId, Set<TopicPartition> partitions, DeleteConsumerGroupOffsetsOptions options) Description copied from interface:AdminDelete 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.- Specified by:
- deleteConsumerGroupOffsetsin interface- Admin
- options- The options to use when deleting offsets in a consumer group.
- Returns:
- The DeleteConsumerGroupOffsetsResult.
 
- 
electLeaderspublic ElectLeadersResult electLeaders(ElectionType electionType, Set<TopicPartition> partitions, ElectLeadersOptions options) Description copied from interface:AdminElect a replica as leader for the givenpartitions, or for all partitions if the argument topartitionsis null.This operation is not transactional so it may succeed for some partitions while fail for others. It may take several seconds after this method returns success for all the brokers in the cluster to become aware that the partitions have new leaders. During this time, Admin.describeTopics(Collection)may not return information about the partitions' new leaders.This operation is supported by brokers with version 2.2.0 or later if preferred election is use; otherwise the brokers most be 2.4.0 or higher. The following exceptions can be anticipated when calling get()on the future obtained from the returnedElectLeadersResult:- ClusterAuthorizationExceptionif the authenticated user didn't have alter access to the cluster.
- UnknownTopicOrPartitionExceptionif the topic or partition did not exist within the cluster.
- InvalidTopicExceptionif the topic was already queued for deletion.
- NotControllerExceptionif the request was sent to a broker that was not the controller for the cluster.
- TimeoutExceptionif the request timed out before the election was complete.
- LeaderNotAvailableExceptionif the preferred leader was not alive or not in the ISR.
 - Specified by:
- electLeadersin interface- Admin
- Parameters:
- electionType- The type of election to conduct.
- partitions- The topics and partitions for which to conduct elections.
- options- The options to use when electing the leaders.
- Returns:
- The ElectLeadersResult.
 
- 
alterPartitionReassignmentspublic AlterPartitionReassignmentsResult alterPartitionReassignments(Map<TopicPartition, Optional<NewPartitionReassignment>> reassignments, AlterPartitionReassignmentsOptions options) Description copied from interface:AdminChange the reassignments for one or more partitions. Providing an empty Optional (e.g viaOptional.empty()) willrevert the reassignment for the associated partition.The following exceptions can be anticipated when calling get()on the futures obtained from the returnedAlterPartitionReassignmentsResult:- ClusterAuthorizationExceptionIf the authenticated user didn't have alter access to the cluster.
- UnknownTopicOrPartitionExceptionIf the topic or partition does not exist within the cluster.
- TimeoutExceptionif the request timed out before the controller could record the new assignments.
- InvalidReplicaAssignmentExceptionIf the specified assignment was not valid.
- NoReassignmentInProgressExceptionIf there was an attempt to cancel a reassignment for a partition which was not being reassigned.
 - Specified by:
- alterPartitionReassignmentsin interface- Admin
- Parameters:
- reassignments- The reassignments to add, modify, or remove. See- NewPartitionReassignment.
- options- The options to use.
- Returns:
- The result.
 
- 
listPartitionReassignmentspublic ListPartitionReassignmentsResult listPartitionReassignments(Optional<Set<TopicPartition>> partitions, ListPartitionReassignmentsOptions options) - Specified by:
- listPartitionReassignmentsin interface- Admin
- Parameters:
- partitions- the partitions we want to get reassignment for, or an empty optional if we want to get the reassignments for all partitions in the cluster
- options- The options to use.
- Returns:
- The result.
 
- 
removeMembersFromConsumerGrouppublic RemoveMembersFromConsumerGroupResult removeMembersFromConsumerGroup(String groupId, RemoveMembersFromConsumerGroupOptions options) Description copied from interface:AdminRemove members from the consumer group by given member identities.For possible error codes, refer to LeaveGroupResponse.- Specified by:
- removeMembersFromConsumerGroupin interface- Admin
- Parameters:
- groupId- The ID of the group to remove member from.
- options- The options to carry removing members' information.
- Returns:
- The MembershipChangeResult.
 
- 
alterConsumerGroupOffsetspublic AlterConsumerGroupOffsetsResult alterConsumerGroupOffsets(String groupId, Map<TopicPartition, OffsetAndMetadata> offsets, AlterConsumerGroupOffsetsOptions options) Description copied from interface:AdminAlters offsets for the specified group. In order to succeed, the group must be empty. This operation is not transactional so it may succeed for some partitions while fail for others. - Specified by:
- alterConsumerGroupOffsetsin interface- Admin
- Parameters:
- groupId- The group for which to alter offsets.
- offsets- A map of offsets by partition with associated metadata. Partitions not specified in the map are ignored.
- options- The options to use when altering the offsets.
- Returns:
- The AlterOffsetsResult.
 
- 
listOffsetspublic ListOffsetsResult listOffsets(Map<TopicPartition, OffsetSpec> topicPartitionOffsets, ListOffsetsOptions options) Description copied from interface:AdminList 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. - Specified by:
- listOffsetsin interface- Admin
- Parameters:
- topicPartitionOffsets- The mapping from partition to the OffsetSpec to look up.
- options- The options to use when retrieving the offsets
- Returns:
- The ListOffsetsResult.
 
- 
describeClientQuotaspublic DescribeClientQuotasResult describeClientQuotas(ClientQuotaFilter filter, DescribeClientQuotasOptions options) Description copied from interface:AdminDescribes all entities matching the provided filter that have at least one client quota configuration value defined.The following exceptions can be anticipated when calling get()on the future from the returnedDescribeClientQuotasResult:- ClusterAuthorizationExceptionIf the authenticated user didn't have describe access to the cluster.
- InvalidRequestExceptionIf the request details are invalid. e.g., an invalid entity type was specified.
- TimeoutExceptionIf the request timed out before the describe could finish.
 This operation is supported by brokers with version 2.6.0 or higher. - Specified by:
- describeClientQuotasin interface- Admin
- Parameters:
- filter- the filter to apply to match entities
- options- the options to use
- Returns:
- the DescribeClientQuotasResult containing the result
 
- 
alterClientQuotaspublic AlterClientQuotasResult alterClientQuotas(Collection<ClientQuotaAlteration> entries, AlterClientQuotasOptions options) Description copied from interface:AdminAlters client quota configurations with the specified alterations.Alterations for a single entity are atomic, but across entities is not guaranteed. The resulting per-entity error code should be evaluated to resolve the success or failure of all updates. The following exceptions can be anticipated when calling get()on the futures obtained from the returnedAlterClientQuotasResult:- ClusterAuthorizationExceptionIf the authenticated user didn't have alter access to the cluster.
- InvalidRequestExceptionIf the request details are invalid. e.g., a configuration key was specified more than once for an entity.
- TimeoutExceptionIf the request timed out before the alterations could finish. It cannot be guaranteed whether the update succeed or not.
 This operation is supported by brokers with version 2.6.0 or higher. - Specified by:
- alterClientQuotasin interface- Admin
- Parameters:
- entries- the alterations to perform
- Returns:
- the AlterClientQuotasResult containing the result
 
- 
describeUserScramCredentialspublic DescribeUserScramCredentialsResult describeUserScramCredentials(List<String> users, DescribeUserScramCredentialsOptions options) Description copied from interface:AdminDescribe SASL/SCRAM credentials.The following exceptions can be anticipated when calling get()on the futures from the returnedDescribeUserScramCredentialsResult:- ClusterAuthorizationExceptionIf the authenticated user didn't have describe access to the cluster.
- ResourceNotFoundExceptionIf the user did not exist/had no SCRAM credentials.
- DuplicateResourceExceptionIf the user was requested to be described more than once in the original request.
- TimeoutExceptionIf the request timed out before the describe operation could finish.
 This operation is supported by brokers with version 2.7.0 or higher. - Specified by:
- describeUserScramCredentialsin interface- Admin
- Parameters:
- users- the users for which credentials are to be described; all users' credentials are described if null or empty.
- options- The options to use when describing the credentials
- Returns:
- The DescribeUserScramCredentialsResult.
 
- 
alterUserScramCredentialspublic AlterUserScramCredentialsResult alterUserScramCredentials(List<UserScramCredentialAlteration> alterations, AlterUserScramCredentialsOptions options) Description copied from interface:AdminAlter SASL/SCRAM credentials.The following exceptions can be anticipated when calling get()any of the futures from the returnedAlterUserScramCredentialsResult:- NotControllerExceptionIf the request is not sent to the Controller broker.
- ClusterAuthorizationExceptionIf the authenticated user didn't have alter access to the cluster.
- UnsupportedByAuthenticationExceptionIf the user authenticated with a delegation token.
- UnsupportedSaslMechanismExceptionIf the requested SCRAM mechanism is unrecognized or otherwise unsupported.
- UnacceptableCredentialExceptionIf the username is empty or the requested number of iterations is too small or too large.
- TimeoutExceptionIf the request timed out before the describe could finish.
 This operation is supported by brokers with version 2.7.0 or higher. - Specified by:
- alterUserScramCredentialsin interface- Admin
- Parameters:
- alterations- the alterations to be applied
- options- The options to use when altering the credentials
- Returns:
- The AlterUserScramCredentialsResult.
 
- 
describeFeaturesDescription copied from interface:AdminDescribes finalized as well as supported features. The request is issued to any random broker.The following exceptions can be anticipated when calling get()on the future from the returnedDescribeFeaturesResult:- TimeoutExceptionIf the request timed out before the describe operation could finish.
 - Specified by:
- describeFeaturesin interface- Admin
- Parameters:
- options- the options to use
- Returns:
- the DescribeFeaturesResultcontaining the result
 
- 
updateFeaturespublic UpdateFeaturesResult updateFeatures(Map<String, FeatureUpdate> featureUpdates, UpdateFeaturesOptions options) Description copied from interface:AdminApplies specified updates to finalized features. This operation is not transactional so some updates may succeed while the rest may fail.The API takes in a map of finalized feature names to FeatureUpdatethat needs to be applied. Each entry in the map specifies the finalized feature to be added or updated or deleted, along with the new max feature version level value. This request is issued only to the controller since the API is only served by the controller. The return value contains an error code for each suppliedFeatureUpdate, and the code indicates if the update succeeded or failed in the controller.- Downgrade of feature version level is not a regular operation/intent. It is only allowed
 in the controller if the FeatureUpdatehas the allowDowngrade flag set. Setting this flag conveys user intent to attempt downgrade of a feature max version level. Note that despite the allowDowngrade flag being set, certain downgrades may be rejected by the controller if it is deemed impossible.
- Deletion of a finalized feature version is not a regular operation/intent. It could be
 done by setting the allowDowngrade flag to true in the FeatureUpdate, and, setting the max version level to a value less than 1.
 The following exceptions can be anticipated when calling get()on the futures obtained from the returnedUpdateFeaturesResult:- ClusterAuthorizationExceptionIf the authenticated user didn't have alter access to the cluster.
- InvalidRequestExceptionIf the request details are invalid. e.g., a non-existing finalized feature is attempted to be deleted or downgraded.
- TimeoutExceptionIf the request timed out before the updates could finish. It cannot be guaranteed whether the updates succeeded or not.
- FeatureUpdateFailedExceptionThis means there was an unexpected error encountered when the update was applied on the controller. There is no guarantee on whether the update succeeded or failed. The best way to find out is to issue a- Admin.describeFeatures(DescribeFeaturesOptions)request.
 This operation is supported by brokers with version 2.7.0 or higher. - Specified by:
- updateFeaturesin interface- Admin
- Parameters:
- featureUpdates- the map of finalized feature name to- FeatureUpdate
- options- the options to use
- Returns:
- the UpdateFeaturesResultcontaining the result
 
- Downgrade of feature version level is not a regular operation/intent. It is only allowed
 in the controller if the 
- 
describeMetadataQuorumDescription copied from interface:AdminDescribes the state of the metadata quorum.The following exceptions can be anticipated when calling get()on the futures obtained from the returnedDescribeMetadataQuorumResult:- ClusterAuthorizationExceptionIf the authenticated user didn't have- DESCRIBEaccess to the cluster.
- TimeoutExceptionIf the request timed out before the controller could list the cluster links.
 - Specified by:
- describeMetadataQuorumin interface- Admin
- Parameters:
- options- The- DescribeMetadataQuorumOptionsto use when describing the quorum.
- Returns:
- the DescribeMetadataQuorumResultcontaining the result
 
- 
unregisterBrokerDescription copied from interface:AdminUnregister a broker.This operation does not have any effect on partition assignments. It is supported only on Kafka clusters which use Raft to store metadata, rather than ZooKeeper. The following exceptions can be anticipated when calling get()on the future from the returnedUnregisterBrokerResult:- TimeoutExceptionIf the request timed out before the describe operation could finish.
- UnsupportedVersionExceptionIf the software is too old to support the unregistration API, or if the cluster is not using Raft to store metadata.
 - Specified by:
- unregisterBrokerin interface- Admin
- Parameters:
- brokerId- the broker id to unregister.
- options- the options to use.
- Returns:
- the UnregisterBrokerResultcontaining the result
 
- 
describeProducerspublic DescribeProducersResult describeProducers(Collection<TopicPartition> partitions, DescribeProducersOptions options) Description copied from interface:AdminDescribe active producer state on a set of topic partitions. Unless a specific broker is requested throughDescribeProducersOptions.brokerId(int), this will query the partition leader to find the producer state.- Specified by:
- describeProducersin interface- Admin
- Parameters:
- partitions- The set of partitions to query
- options- Options to control the method behavior
- Returns:
- The result
 
- 
describeTransactionspublic DescribeTransactionsResult describeTransactions(Collection<String> transactionalIds, DescribeTransactionsOptions options) Description copied from interface:AdminDescribe the state of a set of transactional IDs from the respective transaction coordinators, which are dynamically discovered.- Specified by:
- describeTransactionsin interface- Admin
- Parameters:
- transactionalIds- The set of transactional IDs to query
- options- Options to control the method behavior
- Returns:
- The result
 
- 
abortTransactionpublic AbortTransactionResult abortTransaction(AbortTransactionSpec spec, AbortTransactionOptions options) Description copied from interface:AdminForcefully 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.- Specified by:
- abortTransactionin interface- Admin
- Parameters:
- spec- The transaction specification including topic partition and producer details
- options- Options to control the method behavior (including filters)
- Returns:
- The result
 
- 
listTransactionsDescription copied from interface:AdminList 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 usingListTransactionsOptions.filterProducerIds(Collection)orListTransactionsOptions.filterStates(Collection)orListTransactionsOptions.filterOnDuration(long).- Specified by:
- listTransactionsin interface- Admin
- Parameters:
- options- Options to control the method behavior (including filters)
- Returns:
- The result
 
- 
fenceProducerspublic FenceProducersResult fenceProducers(Collection<String> transactionalIds, FenceProducersOptions options) Description copied from interface:AdminFence out all active producers that use any of the provided transactional IDs.- Specified by:
- fenceProducersin interface- Admin
- Parameters:
- transactionalIds- The IDs of the producers to fence.
- options- The options to use when fencing the producers.
- Returns:
- The FenceProducersResult.
 
- 
listClientMetricsResourcespublic ListClientMetricsResourcesResult listClientMetricsResources(ListClientMetricsResourcesOptions options) Description copied from interface:AdminList the client metrics configuration resources available in the cluster.- Specified by:
- listClientMetricsResourcesin interface- Admin
- Parameters:
- options- The options to use when listing the client metrics resources.
- Returns:
- The ListClientMetricsResourcesResult.
 
- 
clientInstanceIdDescription copied from interface:AdminDetermines the client's unique client instance ID used for telemetry. This ID is unique to this specific client instance and will not change after it is initially generated. The ID is useful for correlating client operations with telemetry sent to the broker and to its eventual monitoring destinations.If telemetry is enabled, this will first require a connection to the cluster to generate the unique client instance ID. This method waits up to timeoutfor the admin client to complete the request.Client telemetry is controlled by the AdminClientConfig.ENABLE_METRICS_PUSH_CONFIGconfiguration option.- Specified by:
- clientInstanceIdin interface- Admin
- Parameters:
- timeout- The maximum time to wait for admin client to determine its client instance ID. The value must be non-negative. Specifying a timeout of zero means do not wait for the initial request to complete if it hasn't already.
- Returns:
- The client's assigned instance id used for metrics collection.
 
- 
metricsDescription copied from interface:AdminGet the metrics kept by the adminClient
 
-