Class KafkaAdminClient
- All Implemented Interfaces:
io.confluent.kafka.clients.CloudAdmin,AutoCloseable,Admin,ConfluentAdmin
Admin. An instance of this class is created by invoking one of the
create() methods in AdminClient. Users should not refer to this class directly.
This class is thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionabortTransaction(AbortTransactionSpec spec, AbortTransactionOptions options) Forcefully abort a transaction which is open on a topic partition.addRaftVoter(int voterId, Uuid voterDirectoryId, Set<RaftVoterEndpoint> endpoints, AddRaftVoterOptions options) Add a new voter node to the KRaft metadata quorum.alterBrokerHealth(AlterBrokerHealthSpec data, AlterBrokerHealthOptions options) alterBrokerReplicaExclusions(Map<Integer, ExclusionOp> operations, AlterBrokerReplicaExclusionsOptions options) Alters the broker replica exclusions in the cluster.io.confluent.kafka.clients.AlterCellResultio.confluent.kafka.clients.AlterCellMigrationResultalterCellMigration(CellMigrationState state, io.confluent.kafka.clients.AlterCellMigrationOptions options) alterClientQuotas(Collection<ClientQuotaAlteration> entries, AlterClientQuotasOptions options) Alters client quota configurations with the specified alterations.alterConsumerGroupOffsets(String groupId, Map<TopicPartition, OffsetAndMetadata> offsets, AlterConsumerGroupOffsetsOptions options) Alters offsets for the specified group.alterMirrors(Map<String, AlterMirrorOp> ops, AlterMirrorsOptions options) Performs a state alteration for topic mirroring.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.alterShareGroupOffsets(String groupId, Map<TopicPartition, Long> offsets, AlterShareGroupOffsetsOptions options) Alters offsets for the specified group.alterStreamsGroupOffsets(String groupId, Map<TopicPartition, OffsetAndMetadata> offsets, AlterStreamsGroupOffsetsOptions options) Alters offsets for the specified group.alterUserScramCredentials(List<UserScramCredentialAlteration> alterations, AlterUserScramCredentialsOptions options) Alter SASL/SCRAM credentials.io.confluent.kafka.clients.AssignBrokersToCellResultassignBrokersToCell(Collection<Integer> brokers, int cellId, boolean force, io.confluent.kafka.clients.AssignBrokersToCellOptions options) io.confluent.kafka.clients.AssignTenantsToCellResultassignTenantsToCells(Collection<org.apache.kafka.common.message.AssignTenantsToCellRequestData.TenantToCellAssignment> assignments, io.confluent.kafka.clients.AssignTenantsToCellOptions options) clientInstanceId(Duration timeout) Determines the client's unique client instance ID used for telemetry.voidClose the Admin client and release all associated resources.computeEvenClusterLoadPlan(List<String> goalList, ComputeEvenClusterLoadPlanOptions options) Compute and return an even cluster load plan for the cluster based on the rebalance goals.createAcls(Collection<AclBinding> acls, CreateAclsOptions options) Creates access control lists (ACLs) which are bound to specific resources.io.confluent.kafka.clients.CreateCellResultcreateCell(int cellId, CellState state, io.confluent.kafka.clients.CreateCellOptions options) createCentralizedAcls(Collection<AclBinding> acls, CreateAclsOptions options, String clusterId, int writerBrokerId) Creates access control lists (ACLs) which are bound to specific resources.createClusterLinks(Collection<NewClusterLink> clusterLinks, CreateClusterLinksOptions options) Creates links to remote clusters with the specified configurations for performing inter-cluster communications.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.io.confluent.kafka.clients.DeleteCellResultdeleteCell(int cellId, io.confluent.kafka.clients.DeleteCellOptions options) deleteCentralizedAcls(Collection<AclBindingFilter> filters, DeleteAclsOptions options, String clusterId, int writerBrokerId) Deletes access control lists (ACLs) according to the supplied filters.deleteClusterLinks(Collection<String> linkNames, DeleteClusterLinksOptions options) Deletes established links to remote clusters with the provided link names.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.deleteShareGroupOffsets(String groupId, Set<String> topics, DeleteShareGroupOffsetsOptions options) Delete offsets for a set of topics in a share group.deleteShareGroups(Collection<String> groupIds, DeleteShareGroupsOptions options) Delete share groups from the cluster.deleteStreamsGroupOffsets(String groupId, Set<TopicPartition> partitions, DeleteStreamsGroupOffsetsOptions options) Delete committed offsets for a set of partitions in a streams group.deleteStreamsGroups(Collection<String> groupIds, DeleteStreamsGroupsOptions options) Delete streams groups from the cluster.io.confluent.kafka.clients.DeleteTenantsResultdeleteTenants(Collection<String> tenantIds, io.confluent.kafka.clients.DeleteTenantsOptions options) 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.Describes status of confluent balancer component.Describes all the broker additions in the cluster.Describes all the broker removals in the cluster.Describes the active broker replica exclusions in the cluster.io.confluent.kafka.clients.CellLoadResultdescribeCellLoad(Collection<Integer> cellIds) io.confluent.kafka.clients.CellLoadResultdescribeCellLoad(Collection<Integer> cellIds, io.confluent.kafka.clients.DescribeCellLoadOptions options) io.confluent.kafka.clients.DescribeCellMigrationResultdescribeCellMigration(io.confluent.kafka.clients.DescribeCellMigrationOptions options) io.confluent.kafka.clients.DescribeCellsResultdescribeCells(Collection<Integer> cellIds, io.confluent.kafka.clients.DescribeCellsOptions options) describeClassicGroups(Collection<String> groupIds, DescribeClassicGroupsOptions options) Describe some classic groups in the cluster.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.Describe the cluster links.voiddescribeClusterLinksToController(DescribeClusterLinksOptions options, org.apache.kafka.common.internals.KafkaFutureImpl<Collection<ClusterLinkDescription>> result, long now) describeConfigs(Collection<ConfigResource> configResources, DescribeConfigsOptions options) Get the configuration for the specified resources.describeConsumerGroups(Collection<String> groupIds, DescribeConsumerGroupsOptions options) Describe some consumer groups in the cluster.Describe the Delegation Tokens.Describe the status of the even cluster load operation.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.describeMirrors(Collection<String> topics, DescribeMirrorsOptions options) Describes the state of mirrored topics, i.e.describeMirrorsToController(DescribeMirrorsOptions options, Map<String, org.apache.kafka.common.internals.KafkaFutureImpl<MirrorTopicDescription>> result, Long now) io.confluent.kafka.clients.DescribeNetworkResultdescribeNetwork(String tenant, String listenerName, Collection<String> ipAddresses, Collection<String> clientApiKeyList, Collection<Integer> brokerIds, io.confluent.kafka.clients.DescribeNetworkOptions options) describeProducers(Collection<TopicPartition> topicPartitions, 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.describeShareGroups(Collection<String> groupIds, DescribeShareGroupsOptions options) Describe some share groups in the cluster.describeStreamsGroups(Collection<String> groupIds, DescribeStreamsGroupsOptions options) Describe streams groups in the cluster.describeSwitchoverStatus(String linkName) Describe the cluster link switchover status.io.confluent.kafka.clients.DescribeTenantsResultdescribeTenants(Collection<String> tenantIds, io.confluent.kafka.clients.DescribeTenantsOptions options) 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> topicPartitions, 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.forceTerminateTransaction(String transactionalId, TerminateTransactionOptions options) Forcefully terminates an ongoing transaction for a given transactional ID.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.listClusterLinks(ListClusterLinksOptions options) Lists the cluster links.listConfigResources(Set<ConfigResource.Type> configResourceTypes, ListConfigResourcesOptions options) List the configuration resources available in the cluster which matches config resource type.listConsumerGroupOffsets(Map<String, ListConsumerGroupOffsetsSpec> groupSpecs, ListConsumerGroupOffsetsOptions options) List the consumer group offsets available in the cluster for the specified consumer groups.Deprecated, for removal: This API element is subject to removal in a future version.listGroups(ListGroupsOptions options) List the groups available in the cluster.listMirrors(ListMirrorsOptions options) Lists the mirrored topics, i.e.listOffsets(Map<TopicPartition, OffsetSpec> topicPartitionOffsets, ListOffsetsOptions options) List offset for the specified partitions.listPartitionReassignments(Optional<Set<TopicPartition>> partitions, ListPartitionReassignmentsOptions options) listShareGroupOffsets(Map<String, ListShareGroupOffsetsSpec> groupSpecs, ListShareGroupOffsetsOptions options) List the share group offsets available in the cluster for the specified share groups.listStreamsGroupOffsets(Map<String, ListStreamsGroupOffsetsSpec> groupSpecs, ListStreamsGroupOffsetsOptions options) List the streams group offsets available in the cluster for the specified streams groups.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 adminClientvoidAdd the provided application metric for subscription.removeBrokers(List<Integer> brokersToRemove, RemoveBrokersOptions options) Drain data off a given set of brokers and remove them from the cluster via shutdown.removeMembersFromConsumerGroup(String groupId, RemoveMembersFromConsumerGroupOptions options) Remove members from the consumer group by given member identities.removeRaftVoter(int voterId, Uuid voterDirectoryId, RemoveRaftVoterOptions options) Remove a voter node from the KRaft metadata quorum.renewDelegationToken(byte[] hmac, RenewDelegationTokenOptions options) Renew a Delegation Token.replicaStatus(Set<TopicPartition> partitions, ReplicaStatusOptions options) Retrieves the status of the replicas for a set of partitions, including observers.reportClusterLinkStatus(Integer publisherBrokerId, Collection<org.apache.kafka.common.requests.ReportClusterLinkStatusRequest.ClusterLinkMirrorState> linkMirrorStates, ReportClusterLinkStatusOptions options) Internal method to report Cluster Link Status.resolveOffsetRange(Map<TopicIdAndPartition, ResolveOffsetRangeSpec> topicPartitionOffsetRanges, ResolveOffsetRangeOptions options) triggerEvenClusterLoad(List<String> goalList, TriggerEvenClusterLoadOptions options) Triggers the even cluster load operation.io.confluent.kafka.clients.UnassignBrokersFromCellResultunassignBrokersFromCell(Collection<Integer> brokers, boolean force, io.confluent.kafka.clients.UnassignBrokersFromCellOptions options) unregisterBroker(int brokerId, UnregisterBrokerOptions options) Unregister a broker.voidRemove the provided application metric for subscription.updateFeatures(Map<String, FeatureUpdate> featureUpdates, UpdateFeaturesOptions options) Applies specified updates to finalized features.Methods inherited from class org.apache.kafka.clients.admin.AdminClient
create, createMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.kafka.clients.admin.Admin
abortTransaction, addRaftVoter, alterClientQuotas, alterConsumerGroupOffsets, alterPartitionReassignments, alterReplicaLogDirs, alterShareGroupOffsets, alterStreamsGroupOffsets, alterUserScramCredentials, close, createAcls, createDelegationToken, createPartitions, createTopics, deleteAcls, deleteConsumerGroupOffsets, deleteConsumerGroups, deleteRecords, deleteShareGroupOffsets, deleteShareGroups, deleteStreamsGroupOffsets, deleteStreamsGroups, deleteTopics, deleteTopics, deleteTopics, describeAcls, describeClassicGroups, describeClientQuotas, describeCluster, describeConfigs, describeConsumerGroups, describeDelegationToken, describeFeatures, describeLogDirs, describeMetadataQuorum, describeProducers, describeReplicaLogDirs, describeShareGroups, describeStreamsGroups, describeTopics, describeTopics, describeTopics, describeTransactions, describeUserScramCredentials, describeUserScramCredentials, electLeaders, expireDelegationToken, fenceProducers, forceTerminateTransaction, incrementalAlterConfigs, listClientMetricsResources, listConfigResources, listConsumerGroupOffsets, listConsumerGroupOffsets, listConsumerGroupOffsets, listConsumerGroups, listGroups, listOffsets, listPartitionReassignments, listPartitionReassignments, listPartitionReassignments, listPartitionReassignments, listShareGroupOffsets, listStreamsGroupOffsets, listTopics, listTransactions, removeRaftVoter, renewDelegationToken, unregisterBrokerMethods inherited from interface io.confluent.kafka.clients.CloudAdmin
alterCell, alterCellMigration, assignBrokersToCell, assignTenantsToCells, createCell, deleteCell, deleteTenants, describeCellMigration, describeCells, describeTenants, unassignBrokersFromCellMethods inherited from interface org.apache.kafka.clients.admin.ConfluentAdmin
alterBrokerReplicaExclusions, computeEvenClusterLoadPlan, computeEvenClusterLoadPlan, describeBalancerStatus, describeBrokerAdditions, describeBrokerRemovals, describeBrokerReplicaExclusions, describeEvenClusterLoadStatus, removeBrokers, triggerEvenClusterLoad, triggerEvenClusterLoad
-
Method Details
-
close
Description 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. -
createTopics
Description 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 interfaceAdmin- Parameters:
newTopics- The new topics to create.options- The options to use when creating the new topics.- Returns:
- The CreateTopicsResult.
-
deleteTopics
Description 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 set to false on the brokers, an exception will be returned to the client indicating that topic deletion is disabled.
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 interfaceAdmin- Parameters:
topics- The topics to delete.options- The options to use when deleting the topics.- Returns:
- The DeleteTopicsResult.
-
listTopics
Description copied from interface:AdminList the topics available in the cluster.- Specified by:
listTopicsin interfaceAdmin- Parameters:
options- The options to use when listing the topics.- Returns:
- The ListTopicsResult.
-
describeTopics
Description 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 interfaceAdmin- Parameters:
topics- The topics to describe.options- The options to use when describing the topics.- Returns:
- The DescribeTopicsResult.
-
describeCluster
Description copied from interface:AdminGet information about the nodes in the cluster.To obtain broker cluster information, you must configure
AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG. To obtain controller cluster information, you must configureAdminClientConfig.BOOTSTRAP_CONTROLLERS_CONFIG.- Specified by:
describeClusterin interfaceAdmin- Parameters:
options- The options to use when getting information about the cluster.- Returns:
- The DescribeClusterResult.
-
describeAcls
Description 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 interfaceAdmin- Parameters:
filter- The filter to use.options- The options to use when listing the ACLs.- Returns:
- The DescribeAclsResult.
-
createAcls
Description 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 interfaceAdmin- Parameters:
acls- The ACLs to createoptions- The options to use when creating the ACLs.- Returns:
- The CreateAclsResult.
-
createCentralizedAcls
@Confluent public CreateAclsResult createCentralizedAcls(Collection<AclBinding> acls, CreateAclsOptions options, String clusterId, int writerBrokerId) Description copied from interface:ConfluentAdminCreates 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:
createCentralizedAclsin interfaceConfluentAdmin- Parameters:
acls- The ACLs to createoptions- The options to use when creating the ACLs.clusterId- Cluster id for which ACLs are being updatedwriterBrokerId- Broker id of the current centralized metadata master writer- Returns:
- The CreateAclsResult.
-
deleteAcls
Description 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 interfaceAdmin- Parameters:
filters- The filters to use.options- The options to use when deleting the ACLs.- Returns:
- The DeleteAclsResult.
-
deleteCentralizedAcls
@Confluent public DeleteAclsResult deleteCentralizedAcls(Collection<AclBindingFilter> filters, DeleteAclsOptions options, String clusterId, int writerBrokerId) Description copied from interface:ConfluentAdminDeletes 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:
deleteCentralizedAclsin interfaceConfluentAdmin- Parameters:
filters- The filters to use.options- The options to use when deleting the ACLs.clusterId- Cluster id for which ACLs are being updatedwriterBrokerId- Broker id of the current centralized metadata master writer- Returns:
- The DeleteAclsResult.
-
resolveOffsetRange
@Confluent public ResolveOffsetRangeResult resolveOffsetRange(Map<TopicIdAndPartition, ResolveOffsetRangeSpec> topicPartitionOffsetRanges, ResolveOffsetRangeOptions options) - Specified by:
resolveOffsetRangein interfaceConfluentAdmin
-
describeConfigs
public DescribeConfigsResult describeConfigs(Collection<ConfigResource> configResources, 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.
The different behavior of nonexistent resource:
ConfigResource.Type.BROKER: will throw aTimeoutExceptionexceptionConfigResource.Type.TOPIC: will throw aUnknownTopicOrPartitionExceptionexceptionConfigResource.Type.GROUP: just return default configs even if the target group is nonexistentConfigResource.Type.BROKER_LOGGER: will throw aTimeoutExceptionexceptionConfigResource.Type.CLIENT_METRICS: will return empty configs
Note that you cannot describe broker configs or broker logger using
AdminClientConfig.BOOTSTRAP_CONTROLLERS_CONFIG, and you cannot describe controller configs or controller logger usingAdminClientConfig.BOOTSTRAP_SERVERS_CONFIG.This operation is supported by brokers with version 0.11.0.0 or higher.
- Specified by:
describeConfigsin interfaceAdmin- Parameters:
configResources- See relevant typeConfigResource.Typeoptions- The options to use when describing configs- Returns:
- The DescribeConfigsResult
-
incrementalAlterConfigs
public 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 interfaceAdmin- Parameters:
configs- The resources with their configsoptions- The options to use when altering configs- Returns:
- The AlterConfigsResult
-
alterReplicaLogDirs
public 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 interfaceAdmin- Parameters:
replicaAssignment- The replicas with their log directory absolute pathoptions- The options to use when changing replica dir- Returns:
- The AlterReplicaLogDirsResult
-
describeLogDirs
public 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 interfaceAdmin- Parameters:
brokers- A list of brokersoptions- The options to use when querying log dir info- Returns:
- The DescribeLogDirsResult
-
describeReplicaLogDirs
public 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 interfaceAdmin- Parameters:
replicas- The replicas to queryoptions- The options to use when querying replica log dir info- Returns:
- The DescribeReplicaLogDirsResult
-
createPartitions
public 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 returnedCreatePartitionsResultAuthorizationExceptionif the authenticated user is not authorized to alter the topicTimeoutExceptionif the request was not completed in within the givenAbstractOptions.timeoutMs().ReassignmentInProgressExceptionif a partition reassignment is currently in progressBrokerNotAvailableExceptionif the requestedNewPartitions.assignments()contain a broker that is currently unavailable.InvalidReplicationFactorExceptionif noNewPartitions.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 interfaceAdmin- 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.
-
deleteRecords
public 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 interfaceAdmin- Parameters:
recordsToDelete- The topic partitions and related offsets from which records deletion starts.options- The options to use when deleting records.- Returns:
- The DeleteRecordsResult.
-
createDelegationToken
Description 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 returnedCreateDelegationTokenResultUnsupportedByAuthenticationExceptionIf 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 givenAbstractOptions.timeoutMs().
- Specified by:
createDelegationTokenin interfaceAdmin- Parameters:
options- The options to use when creating delegation token.- Returns:
- The CreateDelegationTokenResult.
-
renewDelegationToken
public 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 returnedRenewDelegationTokenResultUnsupportedByAuthenticationExceptionIf 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 givenAbstractOptions.timeoutMs().
- Specified by:
renewDelegationTokenin interfaceAdmin- Parameters:
hmac- HMAC of the Delegation tokenoptions- The options to use when renewing delegation token.- Returns:
- The RenewDelegationTokenResult.
-
expireDelegationToken
public 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 returnedExpireDelegationTokenResultUnsupportedByAuthenticationExceptionIf 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 givenAbstractOptions.timeoutMs().
- Specified by:
expireDelegationTokenin interfaceAdmin- Parameters:
hmac- HMAC of the Delegation tokenoptions- The options to use when expiring delegation token.- Returns:
- The ExpireDelegationTokenResult.
-
describeDelegationToken
public 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 returnedDescribeDelegationTokenResultUnsupportedByAuthenticationExceptionIf 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 givenAbstractOptions.timeoutMs().
- Specified by:
describeDelegationTokenin interfaceAdmin- Parameters:
options- The options to use when describing delegation tokens.- Returns:
- The DescribeDelegationTokenResult.
-
listGroups
Description copied from interface:AdminList the groups available in the cluster.- Specified by:
listGroupsin interfaceAdmin- Parameters:
options- The options to use when listing the groups.- Returns:
- The ListGroupsResult.
-
describeConsumerGroups
public DescribeConsumerGroupsResult describeConsumerGroups(Collection<String> groupIds, DescribeConsumerGroupsOptions options) Description copied from interface:AdminDescribe some consumer groups in the cluster.- Specified by:
describeConsumerGroupsin interfaceAdmin- Parameters:
groupIds- The IDs of the groups to describe.options- The options to use when describing the groups.- Returns:
- The DescribeConsumerGroupsResult.
-
listConsumerGroups
@Deprecated(since="4.1", forRemoval=true) public ListConsumerGroupsResult listConsumerGroups(ListConsumerGroupsOptions options) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AdminList the consumer groups available in the cluster.- Specified by:
listConsumerGroupsin interfaceAdmin- Parameters:
options- The options to use when listing the consumer groups.- Returns:
- The ListConsumerGroupsResult.
-
listConsumerGroupOffsets
public 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 interfaceAdmin- 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
-
listStreamsGroupOffsets
public ListStreamsGroupOffsetsResult listStreamsGroupOffsets(Map<String, ListStreamsGroupOffsetsSpec> groupSpecs, ListStreamsGroupOffsetsOptions options) Description copied from interface:AdminList the streams group offsets available in the cluster for the specified streams groups. Note: this method effectively does the same as the corresponding consumer group methodAdmin.listConsumerGroupOffsets(java.lang.String, org.apache.kafka.clients.admin.ListConsumerGroupOffsetsOptions)does.- Specified by:
listStreamsGroupOffsetsin interfaceAdmin- Parameters:
groupSpecs- Map of streams 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 streams group offsets.- Returns:
- The ListStreamsGroupOffsetsResult
-
deleteConsumerGroups
public DeleteConsumerGroupsResult deleteConsumerGroups(Collection<String> groupIds, DeleteConsumerGroupsOptions options) Description copied from interface:AdminDelete consumer groups from the cluster.- Specified by:
deleteConsumerGroupsin interfaceAdmin- Parameters:
options- The options to use when deleting a consumer group.- Returns:
- The DeleteConsumerGroupsResult.
-
deleteStreamsGroups
public DeleteStreamsGroupsResult deleteStreamsGroups(Collection<String> groupIds, DeleteStreamsGroupsOptions options) Description copied from interface:AdminDelete streams groups from the cluster. Note: this method effectively does the same as the corresponding consumer group methodAdmin.deleteConsumerGroups(java.util.Collection<java.lang.String>, org.apache.kafka.clients.admin.DeleteConsumerGroupsOptions)does.- Specified by:
deleteStreamsGroupsin interfaceAdmin- Parameters:
options- The options to use when deleting a streams group.- Returns:
- The DeleteStreamsGroupsResult.
-
deleteConsumerGroupOffsets
public 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 interfaceAdmin- Parameters:
options- The options to use when deleting offsets in a consumer group.- Returns:
- The DeleteConsumerGroupOffsetsResult.
-
deleteStreamsGroupOffsets
public DeleteStreamsGroupOffsetsResult deleteStreamsGroupOffsets(String groupId, Set<TopicPartition> partitions, DeleteStreamsGroupOffsetsOptions options) Description copied from interface:AdminDelete committed offsets for a set of partitions in a streams group. This will succeed at the partition level only if the group is not actively subscribed to the corresponding topic. Note: this method effectively does the same as the corresponding consumer group methodAdmin.deleteConsumerGroupOffsets(java.lang.String, java.util.Set<org.apache.kafka.common.TopicPartition>, org.apache.kafka.clients.admin.DeleteConsumerGroupOffsetsOptions)does.- Specified by:
deleteStreamsGroupOffsetsin interfaceAdmin- Parameters:
options- The options to use when deleting offsets in a streams group.- Returns:
- The DeleteStreamsGroupOffsetsResult.
-
describeStreamsGroups
public DescribeStreamsGroupsResult describeStreamsGroups(Collection<String> groupIds, DescribeStreamsGroupsOptions options) Description copied from interface:AdminDescribe streams groups in the cluster.- Specified by:
describeStreamsGroupsin interfaceAdmin- Parameters:
groupIds- The IDs of the groups to describe.options- The options to use when describing the groups.- Returns:
- The DescribeStreamsGroupsResult.
-
describeClassicGroups
public DescribeClassicGroupsResult describeClassicGroups(Collection<String> groupIds, DescribeClassicGroupsOptions options) Description copied from interface:AdminDescribe some classic groups in the cluster.- Specified by:
describeClassicGroupsin interfaceAdmin- Parameters:
groupIds- The IDs of the groups to describe.options- The options to use when describing the groups.- Returns:
- The DescribeClassicGroupsResult.
-
metrics
-
describeCells
@Confluent public io.confluent.kafka.clients.DescribeCellsResult describeCells(Collection<Integer> cellIds, io.confluent.kafka.clients.DescribeCellsOptions options) - Specified by:
describeCellsin interfaceio.confluent.kafka.clients.CloudAdmin
-
describeNetwork
@Confluent public io.confluent.kafka.clients.DescribeNetworkResult describeNetwork(String tenant, String listenerName, Collection<String> ipAddresses, Collection<String> clientApiKeyList, Collection<Integer> brokerIds, io.confluent.kafka.clients.DescribeNetworkOptions options) - Specified by:
describeNetworkin interfaceio.confluent.kafka.clients.CloudAdmin
-
describeCellLoad
@Confluent public io.confluent.kafka.clients.CellLoadResult describeCellLoad(Collection<Integer> cellIds, io.confluent.kafka.clients.DescribeCellLoadOptions options) - Specified by:
describeCellLoadin interfaceio.confluent.kafka.clients.CloudAdmin
-
deleteCell
@Confluent public io.confluent.kafka.clients.DeleteCellResult deleteCell(int cellId, io.confluent.kafka.clients.DeleteCellOptions options) - Specified by:
deleteCellin interfaceio.confluent.kafka.clients.CloudAdmin
-
createCell
@Confluent public io.confluent.kafka.clients.CreateCellResult createCell(int cellId, CellState state, io.confluent.kafka.clients.CreateCellOptions options) - Specified by:
createCellin interfaceio.confluent.kafka.clients.CloudAdmin
-
alterCell
@Confluent public io.confluent.kafka.clients.AlterCellResult alterCell(int cellId, CellState state, io.confluent.kafka.clients.AlterCellOptions options) - Specified by:
alterCellin interfaceio.confluent.kafka.clients.CloudAdmin
-
assignBrokersToCell
@Confluent public io.confluent.kafka.clients.AssignBrokersToCellResult assignBrokersToCell(Collection<Integer> brokers, int cellId, boolean force, io.confluent.kafka.clients.AssignBrokersToCellOptions options) - Specified by:
assignBrokersToCellin interfaceio.confluent.kafka.clients.CloudAdmin
-
unassignBrokersFromCell
@Confluent public io.confluent.kafka.clients.UnassignBrokersFromCellResult unassignBrokersFromCell(Collection<Integer> brokers, boolean force, io.confluent.kafka.clients.UnassignBrokersFromCellOptions options) - Specified by:
unassignBrokersFromCellin interfaceio.confluent.kafka.clients.CloudAdmin
-
describeTenants
@Confluent public io.confluent.kafka.clients.DescribeTenantsResult describeTenants(Collection<String> tenantIds, io.confluent.kafka.clients.DescribeTenantsOptions options) - Specified by:
describeTenantsin interfaceio.confluent.kafka.clients.CloudAdmin
-
deleteTenants
@Confluent public io.confluent.kafka.clients.DeleteTenantsResult deleteTenants(Collection<String> tenantIds, io.confluent.kafka.clients.DeleteTenantsOptions options) - Specified by:
deleteTenantsin interfaceio.confluent.kafka.clients.CloudAdmin
-
assignTenantsToCells
@Confluent public io.confluent.kafka.clients.AssignTenantsToCellResult assignTenantsToCells(Collection<org.apache.kafka.common.message.AssignTenantsToCellRequestData.TenantToCellAssignment> assignments, io.confluent.kafka.clients.AssignTenantsToCellOptions options) - Specified by:
assignTenantsToCellsin interfaceio.confluent.kafka.clients.CloudAdmin
-
alterCellMigration
@Confluent public io.confluent.kafka.clients.AlterCellMigrationResult alterCellMigration(CellMigrationState state, io.confluent.kafka.clients.AlterCellMigrationOptions options) - Specified by:
alterCellMigrationin interfaceio.confluent.kafka.clients.CloudAdmin
-
describeCellMigration
@Confluent public io.confluent.kafka.clients.DescribeCellMigrationResult describeCellMigration(io.confluent.kafka.clients.DescribeCellMigrationOptions options) - Specified by:
describeCellMigrationin interfaceio.confluent.kafka.clients.CloudAdmin
-
describeCellLoad
- Specified by:
describeCellLoadin interfaceio.confluent.kafka.clients.CloudAdmin
-
electLeaders
public ElectLeadersResult electLeaders(ElectionType electionType, Set<TopicPartition> topicPartitions, 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 interfaceAdmin- Parameters:
electionType- The type of election to conduct.topicPartitions- The topics and partitions for which to conduct elections.options- The options to use when electing the leaders.- Returns:
- The ElectLeadersResult.
-
alterPartitionReassignments
public 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.InvalidReplicationFactorExceptionIf the replication factor was changed in an invalid way. Only thrown whenAlterPartitionReassignmentsOptions.allowReplicationFactorChange()is set to false and the request is attempting to alter reassignments (not cancel)UnsupportedVersionExceptionIfAlterPartitionReassignmentsOptions.allowReplicationFactorChange()was changed outside the default and the server does not support the option (e.g due to an old Kafka version).NoReassignmentInProgressExceptionIf there was an attempt to cancel a reassignment for a partition which was not being reassigned.
- Specified by:
alterPartitionReassignmentsin interfaceAdmin- Parameters:
reassignments- The reassignments to add, modify, or remove. SeeNewPartitionReassignment.options- The options to use.- Returns:
- The result.
-
listPartitionReassignments
public ListPartitionReassignmentsResult listPartitionReassignments(Optional<Set<TopicPartition>> partitions, ListPartitionReassignmentsOptions options) - Specified by:
listPartitionReassignmentsin interfaceAdmin- 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 clusteroptions- The options to use.- Returns:
- The result.
-
replicaStatus
@Confluent public ReplicaStatusResult replicaStatus(Set<TopicPartition> partitions, ReplicaStatusOptions options) Description copied from interface:ConfluentAdminRetrieves the status of the replicas for a set of partitions, including observers.The status of the replicas will be as witnessed by the partition leader. That is, the replicas themselves may be further in progress than what's provided, however the leader has not yet processed that state update.
The following exceptions can be anticipated when calling
get()on the futures obtained from the returnedReplicaStatusResult:TopicAuthorizationExceptionIf the authenticated user didn't have describe access to the Topic.UnknownTopicOrPartitionExceptionIf a given topic or partition does not exist.NotLeaderOrFollowerExceptionIf the partition leader changed while the request was outstanding.TimeoutExceptionIf the request timed out before the controller could retrieve the partition's replica status.
- Specified by:
replicaStatusin interfaceConfluentAdmin- Parameters:
partitions- The partitions to retrieve replica status for.options- The options to use.- Returns:
- The resulting replica status of every requested partition.
-
registerMetricForSubscription
Description copied from interface:AdminAdd the provided application metric for subscription. This metric will be added to this client's metrics that are available for subscription and sent as telemetry data to the broker. The provided metric must map to an OTLP metric data point type in the OpenTelemetry v1 metrics protobuf message types. Specifically, the metric should be one of the following:- `Sum`: Monotonic total count meter (Counter). Suitable for metrics like total number of X, e.g., total bytes sent.
- `Gauge`: Non-monotonic current value meter (UpDownCounter). Suitable for metrics like current value of Y, e.g., current queue count.
- Specified by:
registerMetricForSubscriptionin interfaceAdmin- Parameters:
metric- The application metric to register
-
unregisterMetricFromSubscription
Description copied from interface:AdminRemove the provided application metric for subscription. This metric is removed from this client's metrics and will not be available for subscription any longer. Executing this method with a metric that has not been registered is a benign operation and does not result in any action taken (no-op).- Specified by:
unregisterMetricFromSubscriptionin interfaceAdmin- Parameters:
metric- The application metric to remove
-
removeMembersFromConsumerGroup
public 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 interfaceAdmin- Parameters:
groupId- The ID of the group to remove member from.options- The options to carry removing members' information.- Returns:
- The MembershipChangeResult.
-
alterConsumerGroupOffsets
public 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 interfaceAdmin- 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.
-
alterStreamsGroupOffsets
public AlterStreamsGroupOffsetsResult alterStreamsGroupOffsets(String groupId, Map<TopicPartition, OffsetAndMetadata> offsets, AlterStreamsGroupOffsetsOptions 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. Note: this method effectively does the same as the corresponding consumer group method
Admin.alterConsumerGroupOffsets(java.lang.String, java.util.Map<org.apache.kafka.common.TopicPartition, org.apache.kafka.clients.consumer.OffsetAndMetadata>)does.- Specified by:
alterStreamsGroupOffsetsin interfaceAdmin- 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.
-
listOffsets
public 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 interfaceAdmin- Parameters:
topicPartitionOffsets- The mapping from partition to the OffsetSpec to look up.options- The options to use when retrieving the offsets- Returns:
- The ListOffsetsResult.
-
describeClientQuotas
public 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 interfaceAdmin- Parameters:
filter- the filter to apply to match entitiesoptions- the options to use- Returns:
- the DescribeClientQuotasResult containing the result
-
alterClientQuotas
public 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 interfaceAdmin- Parameters:
entries- the alterations to perform- Returns:
- the AlterClientQuotasResult containing the result
-
describeUserScramCredentials
public 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 interfaceAdmin- 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.
-
alterUserScramCredentials
public 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 interfaceAdmin- Parameters:
alterations- the alterations to be appliedoptions- The options to use when altering the credentials- Returns:
- The AlterUserScramCredentialsResult.
-
alterBrokerReplicaExclusions
@Confluent public AlterBrokerReplicaExclusionsResult alterBrokerReplicaExclusions(Map<Integer, ExclusionOp> operations, AlterBrokerReplicaExclusionsOptions options) Description copied from interface:ConfluentAdminAlters the broker replica exclusions in the cluster. A replica exclusion on a broker ensures that the broker is prohibited from having any new replicas placed on it (be it from partition creation or reassignment).Updates are atomic, meaning that the call will either succeed for all
ExclusionOps or fail for all.The following exceptions can be anticipated when calling
get()on the future obtained from the returnedAlterBrokerReplicaExclusionsResult:ClusterAuthorizationExceptionIf the authenticated user didn't haveALTERaccess to the cluster.TimeoutExceptionIf the request timed out before the controller could fetch even cluster load status.InvalidBrokerReplicaExclusionExceptionIf any givenExclusionOp.reason()is invalid (for the constraints, seeExclusionOp.reason()), or any other exception.UnrepresentableBrokerIdExceptionIf an invalid broker ID was provided.BrokerReplicaExclusionNotFoundExceptionIf an attempt to remove an exclusion which doesn't exist is made.
- Specified by:
alterBrokerReplicaExclusionsin interfaceConfluentAdmin- Parameters:
operations- a map of broker ID to the desiredExclusionOpto be performed on that broker.options- The options to use when altering the broker replica exclusions.- Returns:
- The AlterBrokerReplicaExclusionsResult consisting of the attempted broker replica exclusions.
-
describeBrokerReplicaExclusions
@Confluent public DescribeBrokerReplicaExclusionsResult describeBrokerReplicaExclusions(DescribeBrokerReplicaExclusionsOptions options) Description copied from interface:ConfluentAdminDescribes the active broker replica exclusions in the cluster. An active replica exclusion on a broker ensures that the broker is prohibited from having any new replicas placed on it (be it from partition creation or reassignment).The following exceptions can be anticipated when calling
get()on the future obtained from the returnedDescribeBrokerReplicaExclusionsResult:ClusterAuthorizationExceptionIf the authenticated user didn't haveDESCRIBEaccess to the cluster.TimeoutExceptionIf the request timed out before the controller could fetch even cluster load status.
- Specified by:
describeBrokerReplicaExclusionsin interfaceConfluentAdmin- Parameters:
options- The options to use when describing the broker replica exclusions.- Returns:
- The DescribeBrokerReplicaExclusionsResult consisting of the successfully-altered broker replica exclusions.
-
removeBrokers
@Confluent public RemoveBrokersResult removeBrokers(List<Integer> brokersToRemove, RemoveBrokersOptions options) Description copied from interface:ConfluentAdminDrain data off a given set of brokers and remove them from the cluster via shutdown. This API initiates the removal. It is suggested that the user tracks it viaConfluentAdmin.describeBrokerRemovals()Once initiated, the brokers will be shut down and replicas will be reassigned away from them.
The following exceptions can be anticipated when calling
get()on the futures obtained from the returnedRemoveBrokersResult:ClusterAuthorizationExceptionIf we didn't have sufficient permission to initiate the broker removal. None of the requests started.TimeoutExceptionIf the request timed out before the controller could initiate the broker removal. It cannot be guaranteed whether the removal was initiated or not.BalancerOfflineExceptionIf the Confluent Balancer component is disabled or not started yet. Query its status withConfluentAdmin.describeBalancerStatus()for more informationBalancerLoadErrorIf the Confluent Balancer component failed to load. Query its status withConfluentAdmin.describeBalancerStatus()for more informationBalancerOperationFailedExceptionIf the operation failed during execution of the removal.InsufficientRebalancePlanMetricsExceptionIf computing the rebalance plan for broker removal failed due to insufficient metrics.RebalancePlanComputationExceptionIf computing the rebalance plan for broker removal failed for reasons other than insufficient metrics like not enough disk space, replication factor same as the cluster size in case of broker removal etc.InvalidBrokerRemovalExceptionIf requested broker removal operation is invalid, examples being a non-existent broker ID or some partitions (RF=1) becoming unavailable as a result of the removal.BrokerRemovalInProgressExceptionIf the broker is already being removed.BrokerRemovedExceptionIf the broker was already removed successfully.BalancerBrokerExcludedForReplicaPlacementExceptionIf there are active broker replica exclusions in the cluster for brokers that are not part of the removal request. SeeConfluentAdmin.describeBrokerReplicaExclusions()for more information- Specified by:
removeBrokersin interfaceConfluentAdmin- Parameters:
brokersToRemove- The broker IDs to drain off partition replicas and shut down. Must not be empty.options- The options to use for the request.- Returns:
- The result of the broker removal operation.
-
describeBrokerAdditions
@Confluent public DescribeBrokerAdditionsResult describeBrokerAdditions(DescribeBrokerAdditionsOptions options) Description copied from interface:ConfluentAdminDescribes all the broker additions in the cluster.Note that broker additions can be interrupted by subsequent higher-priority operations (e.g broker removal operations, even if operating on different brokers).
A broker addition's partition reassignment task can be in one of multiple statuses: 1.
PartitionReassignmentsStatus.ERROR- when the broker addition operation failed midway 2.PartitionReassignmentsStatus.PENDING- when the intent of addition is registered but the balancer is yet to start on it (e.g still collecting metrics) 3.PartitionReassignmentsStatus.CANCELED- when the addition is canceled (e.g due to a higher priority operation coming through) 4.PartitionReassignmentsStatus.IN_PROGRESS- when the addition is in progress (replicas are being reassigned) 5.PartitionReassignmentsStatus.COMPLETED- when the broker has successfully been added to the clusterThe operation's status is also exposed through the general #
BalancerOperationStatus, which can be in one of the following statuses: 1. #BalancerOperationStatus.FAILED- when the operation has ceased before completing due to an external influence canceling it or an internal error failing it. 2. #BalancerOperationStatus.IN_PROGRESS- when the intent of the operation is registered and is in the process of being completed. 3. #BalancerOperationStatus.SUCCESS- when the balancer operation has completed successfully.Additionally, each broker addition exposes a #
BrokerAdditionDescription.additionError()that provides additional context regarding the reason the operation is in the given statusThe following exceptions can be anticipated when calling
get()on the futures obtained from the returnedDescribeBrokerAdditionsResult:BalancerOfflineExceptionIf the Confluent Balancer component is disabled or not started yet. Query its status withConfluentAdmin.describeBalancerStatus()for more informationBalancerLoadErrorIf the Confluent Balancer component failed to load. Query its status withConfluentAdmin.describeBalancerStatus()for more informationClusterAuthorizationExceptionIf the authenticated user didn't haveDESCRIBEaccess to the cluster.TimeoutExceptionIf the request timed out before the controller could describe the removals.
- Specified by:
describeBrokerAdditionsin interfaceConfluentAdmin- Parameters:
options- The options to use when describing the broker additions- Returns:
- The DescribeBrokerAdditionsResult
-
describeBrokerRemovals
@Confluent public DescribeBrokerRemovalsResult describeBrokerRemovals(DescribeBrokerRemovalsOptions options) Description copied from interface:ConfluentAdminDescribes all the broker removals in the cluster. Note that a removal is considered cleared once a broker starts up with 0 partitions.A broker removal consists of broker shutdown and partition reassignments that move all replicas the now-shutdown broker hosted away from it. The status of the removal is tracked by two separate status fields: 1. #
BrokerRemovalDescription.shutdownStatus(), a #BrokerShutdownStatusdenoting the status of the shutdown operation 2. #BrokerRemovalDescription.reassignmentsStatus(), a #PartitionReassignmentsStatusdenoting the status of the partition reassignments operationWhen at least one of the two has a failed status, the broker removal operation is considered failed. The user is expected to retry the removal via #
ConfluentAdmin.removeBrokers(List).When both have a completed status, the broker removal operation is considered a success.
ClusterAuthorizationExceptionIf the authenticated user didn't haveDESCRIBEaccess to the cluster.TimeoutExceptionIf the request timed out before the controller could describe the removals.BalancerOfflineExceptionIf the Confluent Balancer component is disabled or not started yet. Query its status withConfluentAdmin.describeBalancerStatus()for more informationBalancerLoadErrorIf the Confluent Balancer component failed to load. Query its status withConfluentAdmin.describeBalancerStatus()for more information
The following exceptions can be anticipated when calling
get()on the futures obtained from the returnedDescribeBrokerRemovalsResult:- Specified by:
describeBrokerRemovalsin interfaceConfluentAdmin- Parameters:
options- The options to use when describing the broker removals.- Returns:
- The DescribeBrokerRemovalResult.
-
describeBalancerStatus
@Confluent public DescribeBalancerStatusResult describeBalancerStatus(DescribeBalancerStatusOptions options) Description copied from interface:ConfluentAdminDescribes status of confluent balancer component. The Confluent Balancer can have one of the state fromBalancerStatus.In addition to the status field, the #
BalancerStatusDescription.balancerOperationError()gives context about the status of the balancer, e.g. why the balancer is in error state etc.The following exceptions can be anticipated when calling
get()on the future obtained from the returnedDescribeBalancerStatusResult:ClusterAuthorizationExceptionIf the authenticated user didn't haveDESCRIBEaccess to the cluster.TimeoutExceptionIf the request timed out before the controller could fetch balancer status.
- Specified by:
describeBalancerStatusin interfaceConfluentAdmin- Parameters:
options- The options to use when fetching the balancer status.- Returns:
- The DescribeBalancerStatusResult
-
triggerEvenClusterLoad
public TriggerEvenClusterLoadResult triggerEvenClusterLoad(List<String> goalList, TriggerEvenClusterLoadOptions options) Description copied from interface:ConfluentAdminTriggers the even cluster load operation.If
ConfluentConfigs.BALANCER_AUTO_HEAL_MODE_CONFIGis configured toConfluentConfigs.BalancerSelfHealMode.ANY_UNEVEN_LOAD, then Confluent Balancer is continuously monitoring the cluster and determining whether it can improve the balance of the cluster's load. This API helps manually trigger the operation.The following exceptions can be anticipated when calling
get()on the futures obtained from the returnedTriggerEvenClusterLoadResult:ClusterAuthorizationExceptionIf we didn't have sufficient permission to request rebalance. The request would not be started.TimeoutExceptionIf the request timed out as no response was received from the controller, possible reasons could be request was faulted or response being dropped due to some network issue etc. The status of the even cluster load is unknown in this case.BalancerOfflineExceptionIf the Confluent Balancer component is disabled or not started yet. Query its status withConfluentAdmin.describeBalancerStatus()for more informationBalancerLoadErrorIf the Confluent Balancer component failed to load. Query its status withConfluentAdmin.describeBalancerStatus()for more informationBrokerRemovalInProgressExceptionIf a broker removal operation is in progress.BrokerAdditionInProgressExceptionIf a broker addition operation is in progress.EvenClusterLoadTaskInProgressExceptionIf an even cluster load operation is already in progress.- Specified by:
triggerEvenClusterLoadin interfaceConfluentAdmin- Parameters:
goalList- The list of goals to use for manual rebalance, or an empty list for default goalsoptions- The options to use for the request.- Returns:
- The result of the even cluster load request whether it was accepted or denied.
-
computeEvenClusterLoadPlan
@Confluent public ComputeEvenClusterLoadPlanResult computeEvenClusterLoadPlan(List<String> goalList, ComputeEvenClusterLoadPlanOptions options) Description copied from interface:ConfluentAdminCompute and return an even cluster load plan for the cluster based on the rebalance goals.The following exceptions can be anticipated for when calling
get()on the futures obtained from the returnedComputeEvenClusterLoadPlanResult:ClusterAuthorizationExceptionIf we didn't have sufficient permission to request rebalance plan. The request would not be started.TimeoutExceptionIf the request timed out as no response was received from the controller, possible reasons could be request was faulted or response being dropped due to some network issue etc.BalancerOfflineExceptionIf the Confluent Balancer component is disabled or not started yet. Query its status withConfluentAdmin.describeBalancerStatus()for more information.BalancerLoadErrorIf the Confluent Balancer component failed to load. Query its status withConfluentAdmin.describeBalancerStatus()for more information.BrokerRemovalInProgressExceptionIf a broker removal operation is in progress.BrokerAdditionInProgressExceptionIf a broker addition operation is in progress.EvenClusterLoadTaskInProgressExceptionIf an even cluster load operation is in progress.BrokerFailureFixInProgressExceptionIf there's an ongoing broker failure anomaly fix.RebalancePlanComputationExceptionIf there's an issue with SBC's plan computation process.- Specified by:
computeEvenClusterLoadPlanin interfaceConfluentAdmin- Parameters:
goalList- The list of goals to use for manual rebalance, or an empty list for default goalsoptions- The options to use for the request.- Returns:
- The result of the even cluster load plan computation.
-
describeEvenClusterLoadStatus
public DescribeEvenClusterLoadStatusResult describeEvenClusterLoadStatus(DescribeEvenClusterLoadStatusOptions options) Description copied from interface:ConfluentAdminDescribe the status of the even cluster load operation.If enabled, Confluent Balancer is continuously monitoring the cluster and determining whether it can improve the balance of the cluster's load. This API helps describe the status of the operation.
The following exceptions can be anticipated when calling
get()on the future obtained from the returnedDescribeEvenClusterLoadStatusResult:ClusterAuthorizationExceptionIf the authenticated user didn't haveDESCRIBEaccess to the cluster.TimeoutExceptionIf the request timed out before the controller could fetch even cluster load status.
- Specified by:
describeEvenClusterLoadStatusin interfaceConfluentAdmin- Parameters:
options- The options to use when fetching the even cluster load status.- Returns:
- The DescribeEvenClusterLoadStatusResult
-
createClusterLinks
@Confluent public CreateClusterLinksResult createClusterLinks(Collection<NewClusterLink> clusterLinks, CreateClusterLinksOptions options) Description copied from interface:ConfluentAdminCreates links to remote clusters with the specified configurations for performing inter-cluster communications. Once established, the cluster links can referenced by their link names for issuing requests.The following exceptions can be anticipated when calling get()on the futures obtained from the returnedCreateClusterLinksResult:BalancerOfflineExceptionIf the Confluent Balancer component is disabled or not started yet. Query its status withConfluentAdmin.describeBalancerStatus()for more informationBalancerLoadErrorIf the Confluent Balancer component failed to load. Query its status withConfluentAdmin.describeBalancerStatus()for more informationInvalidClusterLinkExceptionIf the cluster link name is illegal.ClusterAuthorizationExceptionIf the authenticated user didn't haveCREATEaccess to the cluster.ClusterLinkExistsExceptionIf a cluster link already exists for the provided link name.TimeoutExceptionIf the request timed out before the controller could create the cluster link.
- Specified by:
createClusterLinksin interfaceConfluentAdmin- Parameters:
clusterLinks- The cluster links to create.options- The options to use when creating the cluster links.- Returns:
- The CreateClusterLinksResult.
-
listClusterLinks
Description copied from interface:ConfluentAdminLists the cluster links.The following exceptions can be anticipated when calling
get()on the futures obtained from the returnedListClusterLinksResult:ClusterAuthorizationExceptionIf the authenticated user didn't haveDESCRIBEaccess to the cluster.TimeoutExceptionIf the request timed out before the controller could list the cluster links.
- Specified by:
listClusterLinksin interfaceConfluentAdmin- Parameters:
options- The options to use when listing the cluster links.- Returns:
- The ListClusterLinksResult.
-
describeClusterLinks
@Confluent public DescribeClusterLinksResult describeClusterLinks(DescribeClusterLinksOptions options) Description copied from interface:ConfluentAdminDescribe the cluster links.The following exceptions can be anticipated when calling
get()on the futures obtained from the returnedDescribeClusterLinksResult:ClusterAuthorizationExceptionIf the authenticated user didn't haveDESCRIBEaccess to the cluster.NotControllerExceptionIf the Kafka broker is not a controller.ClusterLinkDisabledExceptionIf cluster link is disabled.TimeoutExceptionIf the request timed out before the controller could list the cluster links.
- Specified by:
describeClusterLinksin interfaceConfluentAdmin- Parameters:
options- The options to use when describing the cluster links. When no link name is provided, all the cluster links descriptions will be returned.- Returns:
- The DescribeClusterLinksResult.
-
describeClusterLinksToController
public void describeClusterLinksToController(DescribeClusterLinksOptions options, org.apache.kafka.common.internals.KafkaFutureImpl<Collection<ClusterLinkDescription>> result, long now) -
deleteClusterLinks
@Confluent public DeleteClusterLinksResult deleteClusterLinks(Collection<String> linkNames, DeleteClusterLinksOptions options) Description copied from interface:ConfluentAdminDeletes established links to remote clusters with the provided link names.Deleting a cluster link does not affect the cluster link's data in any way.
The following exceptions can be anticipated when calling
get()on the futures obtained from the returnedDeleteClusterLinksResult:InvalidClusterLinkExceptionIf the cluster link name is illegal.ClusterAuthorizationExceptionIf the authenticated user didn't haveDELETEaccess to the cluster.ClusterLinkNotFoundExceptionIf the cluster link to delete doesn't exist.TimeoutExceptionIf the request timed out before the controller could delete the cluster link.
- Specified by:
deleteClusterLinksin interfaceConfluentAdmin- Parameters:
linkNames- The names of the cluster links to delete.options- The options to use when deleting the cluster links.- Returns:
- The DeleteClusterLinksResult.
-
alterMirrors
@Confluent public AlterMirrorsResult alterMirrors(Map<String, AlterMirrorOp> ops, AlterMirrorsOptions options) Description copied from interface:ConfluentAdminPerforms a state alteration for topic mirroring. Used only for operations on mirror topics.The future of the individual alter mirror ops should be used for obtaining the result.
The following exceptions can be anticipated when calling
get()on the futures obtained from the returnedAlterMirrorsResult:TopicAuthorizationExceptionIf the authenticated user didn't haveALTERaccess to the topic.TimeoutExceptionIf the request timed out before the controller could complete the mirror operation.
- Specified by:
alterMirrorsin interfaceConfluentAdmin- Parameters:
ops- The mirror alteration operation for each topic.options- The options to use when altering mirrors.- Returns:
- The AlterMirrorsResult.
-
listMirrors
Description copied from interface:ConfluentAdminLists the mirrored topics, i.e. topics that are mirrors of another over a cluster link.The following exceptions can be anticipated when calling
get()on the future obtained from the returnedListMirrorsResult:ClusterAuthorizationExceptionIf the authenticated user didn't haveDESCRIBEaccess to the cluster.ClusterLinkNotFoundExceptionIf a specific cluster link was requested and the cluster link doesn't exist.TimeoutExceptionIf the request timed out before the controller could complete the operation.
- Specified by:
listMirrorsin interfaceConfluentAdmin- Parameters:
options- The options to use when listing mirrors.- Returns:
- The ListMirrorsResult.
-
describeMirrors
@Confluent public DescribeMirrorsResult describeMirrors(Collection<String> topics, DescribeMirrorsOptions options) Description copied from interface:ConfluentAdminDescribes the state of mirrored topics, i.e. topics that are mirrors of another over a cluster link.The following exceptions can be anticipated when calling
get()on the futures obtained from the returnedDescribeMirrorsResult:ClusterAuthorizationExceptionIf the authenticated user didn't haveDESCRIBEaccess to the cluster.TimeoutExceptionIf the request timed out before the controller could complete the operation.
- Specified by:
describeMirrorsin interfaceConfluentAdmin- Parameters:
options- The options to use when describing mirrors.- Returns:
- The DescribeMirrorsResult.
-
describeMirrorsToController
public DescribeMirrorsResult describeMirrorsToController(DescribeMirrorsOptions options, Map<String, org.apache.kafka.common.internals.KafkaFutureImpl<MirrorTopicDescription>> result, Long now) -
describeSwitchoverStatus
Description copied from interface:ConfluentAdminDescribe the cluster link switchover status.The following exceptions can be anticipated when calling
get()on the futures obtained from the returnedDescribeSwitchoverStatusResult:ClusterAuthorizationExceptionIf the authenticated user didn't haveDESCRIBEaccess to the cluster.ClusterLinkDisabledExceptionIf cluster link is disabled.TimeoutExceptionIf the request timed out before the controller could list the cluster links.
- Specified by:
describeSwitchoverStatusin interfaceConfluentAdmin- Parameters:
linkName- The link name of the cluster- Returns:
- The DescribeSwitchoverStatusResult.
-
alterBrokerHealth
@Confluent public AlterBrokerHealthResult alterBrokerHealth(AlterBrokerHealthSpec data, AlterBrokerHealthOptions options) - Specified by:
alterBrokerHealthin interfaceio.confluent.kafka.clients.CloudAdmin
-
describeBrokerHealth
@Confluent public DescribeBrokerHealthResult describeBrokerHealth(DescribeBrokerHealthOptions options) - Specified by:
describeBrokerHealthin interfaceio.confluent.kafka.clients.CloudAdmin
-
describeFeatures
Description 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 interfaceAdmin- Parameters:
options- the options to use- Returns:
- the
DescribeFeaturesResultcontaining the result
-
updateFeatures
public 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.- Downgrading a feature version level is not a common operation and should only be
performed when necessary. It is permitted only if the
FeatureUpdatespecifies theupgradeTypeas eitherFeatureUpdate.UpgradeType.SAFE_DOWNGRADEorFeatureUpdate.UpgradeType.UNSAFE_DOWNGRADE.SAFE_DOWNGRADE: Allows downgrades that do not lead to metadata loss.UNSAFE_DOWNGRADE: Permits downgrades that might result in metadata loss.
- Deleting a finalized feature version is also not a common operation. To delete a feature,
set the
maxVersionLevelto zero and specify theupgradeTypeas eitherFeatureUpdate.UpgradeType.SAFE_DOWNGRADEorFeatureUpdate.UpgradeType.UNSAFE_DOWNGRADE. - The
FeatureUpdate.UpgradeType.UPGRADEtype cannot be used when themaxVersionLevelis zero. Attempting to do so will result in anIllegalArgumentException.
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 aAdmin.describeFeatures(DescribeFeaturesOptions)request.
This operation is supported by brokers with version 2.7.0 or higher.
- Specified by:
updateFeaturesin interfaceAdmin- Parameters:
featureUpdates- the map of finalized feature name toFeatureUpdateoptions- the options to use- Returns:
- the
UpdateFeaturesResultcontaining the result
- Downgrading a feature version level is not a common operation and should only be
performed when necessary. It is permitted only if the
-
describeMetadataQuorum
Description 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 haveDESCRIBEaccess to the cluster.TimeoutExceptionIf the request timed out before the controller could list the cluster links.
- Specified by:
describeMetadataQuorumin interfaceAdmin- Parameters:
options- TheDescribeMetadataQuorumOptionsto use when describing the quorum.- Returns:
- the
DescribeMetadataQuorumResultcontaining the result
-
unregisterBroker
Description copied from interface:AdminUnregister a broker.This operation does not have any effect on partition assignments. 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.
- Specified by:
unregisterBrokerin interfaceAdmin- Parameters:
brokerId- the broker id to unregister.options- the options to use.- Returns:
- the
UnregisterBrokerResultcontaining the result
-
describeProducers
public DescribeProducersResult describeProducers(Collection<TopicPartition> topicPartitions, 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 interfaceAdmin- Parameters:
topicPartitions- The set of partitions to queryoptions- Options to control the method behavior- Returns:
- The result
-
describeTransactions
public 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 interfaceAdmin- Parameters:
transactionalIds- The set of transactional IDs to queryoptions- Options to control the method behavior- Returns:
- The result
-
abortTransaction
public 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 interfaceAdmin- Parameters:
spec- The transaction specification including topic partition and producer detailsoptions- Options to control the method behavior (including filters)- Returns:
- The result
-
forceTerminateTransaction
public TerminateTransactionResult forceTerminateTransaction(String transactionalId, TerminateTransactionOptions options) Forcefully terminates an ongoing transaction for a given transactional ID.This API is intended for well-formed but long-running transactions that are known to the transaction coordinator. It is primarily designed for supporting 2PC (two-phase commit) workflows, where a coordinator may need to unilaterally terminate a participant transaction that hasn't completed.
- Specified by:
forceTerminateTransactionin interfaceAdmin- Parameters:
transactionalId- The transactional ID whose active transaction should be forcefully terminated.options- The options to use when terminating the transaction.- Returns:
- a
TerminateTransactionResultthat can be used to await the operation result.
-
listTransactions
Description 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 interfaceAdmin- Parameters:
options- Options to control the method behavior (including filters)- Returns:
- The result
-
fenceProducers
public 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 interfaceAdmin- Parameters:
transactionalIds- The IDs of the producers to fence.options- The options to use when fencing the producers.- Returns:
- The FenceProducersResult.
-
listConfigResources
public ListConfigResourcesResult listConfigResources(Set<ConfigResource.Type> configResourceTypes, ListConfigResourcesOptions options) Description copied from interface:AdminList 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.- Specified by:
listConfigResourcesin interfaceAdmin- Parameters:
configResourceTypes- The set of configuration resource types to list.options- The options to use when listing the configuration resources.- Returns:
- The ListConfigurationResourcesResult.
-
listClientMetricsResources
public ListClientMetricsResourcesResult listClientMetricsResources(ListClientMetricsResourcesOptions options) Description copied from interface:AdminList the client metrics configuration resources available in the cluster.- Specified by:
listClientMetricsResourcesin interfaceAdmin- Parameters:
options- The options to use when listing the client metrics resources.- Returns:
- The ListClientMetricsResourcesResult.
-
addRaftVoter
public AddRaftVoterResult addRaftVoter(int voterId, Uuid voterDirectoryId, Set<RaftVoterEndpoint> endpoints, AddRaftVoterOptions options) Description copied from interface:AdminAdd a new voter node to the KRaft metadata quorum.The clusterId in
AddRaftVoterOptionsis optional. If provided, the operation will only succeed if the cluster id matches the id of the current cluster. If the cluster id does not match, the operation will fail withInconsistentClusterIdException. If not provided, the cluster id check is skipped.- Specified by:
addRaftVoterin interfaceAdmin- Parameters:
voterId- The node ID of the voter.voterDirectoryId- The directory ID of the voter.endpoints- The endpoints that the new voter has.options- Additional options for the operation, including optional cluster ID.
-
removeRaftVoter
public RemoveRaftVoterResult removeRaftVoter(int voterId, Uuid voterDirectoryId, RemoveRaftVoterOptions options) Description copied from interface:AdminRemove a voter node from the KRaft metadata quorum.The clusterId in
RemoveRaftVoterOptionsis optional. If provided, the operation will only succeed if the cluster id matches the id of the current cluster. If the cluster id does not match, the operation will fail withInconsistentClusterIdException. If not provided, the cluster id check is skipped.- Specified by:
removeRaftVoterin interfaceAdmin- Parameters:
voterId- The node ID of the voter.voterDirectoryId- The directory ID of the voter.options- Additional options for the operation, including optional cluster ID.
-
clientInstanceId
Description 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 interfaceAdmin- 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.
-
reportClusterLinkStatus
public ReportClusterLinkStatusResult reportClusterLinkStatus(Integer publisherBrokerId, Collection<org.apache.kafka.common.requests.ReportClusterLinkStatusRequest.ClusterLinkMirrorState> linkMirrorStates, ReportClusterLinkStatusOptions options) Internal method to report Cluster Link Status. This method is invoked using ConfluentAdminUtils.
-