Interface Admin
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
AdminClient,KafkaAdminClient
@Evolving public interface Admin extends java.lang.AutoCloseable
The administrative client for Kafka, which supports managing and inspecting topics, brokers, configurations and ACLs.The minimum broker version required is 0.10.0.0. Methods with stricter requirements will specify the minimum broker version required.
This client was introduced in 0.11.0.0 and the API is still evolving. We will try to evolve the API in a compatible manner, but we reserve the right to make breaking changes in minor releases, if necessary. We will update the
InterfaceStabilityannotation and this notice once the API is considered stable.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default AlterClientQuotasResultalterClientQuotas(java.util.Collection<org.apache.kafka.common.quota.ClientQuotaAlteration> entries)Alters client quota configurations with the specified alterations.AlterClientQuotasResultalterClientQuotas(java.util.Collection<org.apache.kafka.common.quota.ClientQuotaAlteration> entries, AlterClientQuotasOptions options)Alters client quota configurations with the specified alterations.default AlterConfigsResultalterConfigs(java.util.Map<ConfigResource,Config> configs)Deprecated.Since 2.3.AlterConfigsResultalterConfigs(java.util.Map<ConfigResource,Config> configs, AlterConfigsOptions options)Deprecated.Since 2.3.default AlterConsumerGroupOffsetsResultalterConsumerGroupOffsets(java.lang.String groupId, java.util.Map<TopicPartition,OffsetAndMetadata> offsets)Alters offsets for the specified group.AlterConsumerGroupOffsetsResultalterConsumerGroupOffsets(java.lang.String groupId, java.util.Map<TopicPartition,OffsetAndMetadata> offsets, AlterConsumerGroupOffsetsOptions options)Alters offsets for the specified group.default AlterPartitionReassignmentsResultalterPartitionReassignments(java.util.Map<TopicPartition,java.util.Optional<NewPartitionReassignment>> reassignments)Change the reassignments for one or more partitions.AlterPartitionReassignmentsResultalterPartitionReassignments(java.util.Map<TopicPartition,java.util.Optional<NewPartitionReassignment>> reassignments, AlterPartitionReassignmentsOptions options)Change the reassignments for one or more partitions.default AlterReplicaLogDirsResultalterReplicaLogDirs(java.util.Map<TopicPartitionReplica,java.lang.String> replicaAssignment)This API is not supported.AlterReplicaLogDirsResultalterReplicaLogDirs(java.util.Map<TopicPartitionReplica,java.lang.String> replicaAssignment, AlterReplicaLogDirsOptions options)This API is not supported.default voidclose()Close the Admin and release all associated resources.default voidclose(long duration, java.util.concurrent.TimeUnit unit)Deprecated.Since 2.2.voidclose(java.time.Duration timeout)Close the Admin client and release all associated resources.static Admincreate(java.util.Map<java.lang.String,java.lang.Object> conf)Create a new Admin with the given configuration.static Admincreate(java.util.Properties props)Create a new Admin with the given configuration.default CreateAclsResultcreateAcls(java.util.Collection<AclBinding> acls)This API is not supported.CreateAclsResultcreateAcls(java.util.Collection<AclBinding> acls, CreateAclsOptions options)This API is not supported.default CreateDelegationTokenResultcreateDelegationToken()Create a Delegation Token.CreateDelegationTokenResultcreateDelegationToken(CreateDelegationTokenOptions options)Create a Delegation Token.default CreatePartitionsResultcreatePartitions(java.util.Map<java.lang.String,NewPartitions> newPartitions)Increase the number of partitions of the topics given as the keys ofnewPartitionsaccording to the corresponding values.CreatePartitionsResultcreatePartitions(java.util.Map<java.lang.String,NewPartitions> newPartitions, CreatePartitionsOptions options)Increase the number of partitions of the topics given as the keys ofnewPartitionsaccording to the corresponding values.default CreateTopicsResultcreateTopics(java.util.Collection<NewTopic> newTopics)Create a batch of new topics with the default options.CreateTopicsResultcreateTopics(java.util.Collection<NewTopic> newTopics, CreateTopicsOptions options)Create a batch of new topics.default DeleteAclsResultdeleteAcls(java.util.Collection<AclBindingFilter> filters)This API is not supported.DeleteAclsResultdeleteAcls(java.util.Collection<AclBindingFilter> filters, DeleteAclsOptions options)This API is not supported.default DeleteConsumerGroupOffsetsResultdeleteConsumerGroupOffsets(java.lang.String groupId, java.util.Set<TopicPartition> partitions)Delete committed offsets for a set of partitions in a consumer group with the default options.DeleteConsumerGroupOffsetsResultdeleteConsumerGroupOffsets(java.lang.String groupId, java.util.Set<TopicPartition> partitions, DeleteConsumerGroupOffsetsOptions options)Delete committed offsets for a set of partitions in a consumer group.default DeleteConsumerGroupsResultdeleteConsumerGroups(java.util.Collection<java.lang.String> groupIds)Delete consumer groups from the cluster with the default options.DeleteConsumerGroupsResultdeleteConsumerGroups(java.util.Collection<java.lang.String> groupIds, DeleteConsumerGroupsOptions options)Delete consumer groups from the cluster.default DeleteRecordsResultdeleteRecords(java.util.Map<TopicPartition,RecordsToDelete> recordsToDelete)This API is not supported.DeleteRecordsResultdeleteRecords(java.util.Map<TopicPartition,RecordsToDelete> recordsToDelete, DeleteRecordsOptions options)This API is not supported.default DeleteTopicsResultdeleteTopics(java.util.Collection<java.lang.String> topics)This is a convenience method fordeleteTopics(Collection, DeleteTopicsOptions)with default options.DeleteTopicsResultdeleteTopics(java.util.Collection<java.lang.String> topics, DeleteTopicsOptions options)Delete a batch of topics.default DescribeAclsResultdescribeAcls(AclBindingFilter filter)This API is not supported.DescribeAclsResultdescribeAcls(AclBindingFilter filter, DescribeAclsOptions options)This API is not supported.default DescribeClientQuotasResultdescribeClientQuotas(org.apache.kafka.common.quota.ClientQuotaFilter filter)Describes all entities matching the provided filter that have at least one client quota configuration value defined.DescribeClientQuotasResultdescribeClientQuotas(org.apache.kafka.common.quota.ClientQuotaFilter filter, DescribeClientQuotasOptions options)Describes all entities matching the provided filter that have at least one client quota configuration value defined.default DescribeClusterResultdescribeCluster()Get information about the nodes in the cluster, using the default options.DescribeClusterResultdescribeCluster(DescribeClusterOptions options)Get information about the nodes in the cluster.default DescribeConfigsResultdescribeConfigs(java.util.Collection<ConfigResource> resources)This API is not supported.DescribeConfigsResultdescribeConfigs(java.util.Collection<ConfigResource> resources, DescribeConfigsOptions options)This API is not supported.default DescribeConsumerGroupsResultdescribeConsumerGroups(java.util.Collection<java.lang.String> groupIds)Describe some group IDs in the cluster, with the default options.DescribeConsumerGroupsResultdescribeConsumerGroups(java.util.Collection<java.lang.String> groupIds, DescribeConsumerGroupsOptions options)Describe some group IDs in the cluster.default DescribeDelegationTokenResultdescribeDelegationToken()Describe the Delegation Tokens.DescribeDelegationTokenResultdescribeDelegationToken(DescribeDelegationTokenOptions options)Describe the Delegation Tokens.default DescribeLogDirsResultdescribeLogDirs(java.util.Collection<java.lang.Integer> brokers)This API is not supported.DescribeLogDirsResultdescribeLogDirs(java.util.Collection<java.lang.Integer> brokers, DescribeLogDirsOptions options)This API is not supported.default DescribeReplicaLogDirsResultdescribeReplicaLogDirs(java.util.Collection<TopicPartitionReplica> replicas)This API is not supported.DescribeReplicaLogDirsResultdescribeReplicaLogDirs(java.util.Collection<TopicPartitionReplica> replicas, DescribeReplicaLogDirsOptions options)This API is not supported.default DescribeTopicsResultdescribeTopics(java.util.Collection<java.lang.String> topicNames)Describe some topics in the cluster, with the default options.DescribeTopicsResultdescribeTopics(java.util.Collection<java.lang.String> topicNames, DescribeTopicsOptions options)Describe some topics in the cluster.default ElectLeadersResultelectLeaders(ElectionType electionType, java.util.Set<TopicPartition> partitions)Elect a replica as leader for topic partitions.ElectLeadersResultelectLeaders(ElectionType electionType, java.util.Set<TopicPartition> partitions, ElectLeadersOptions options)Elect a replica as leader for the givenpartitions, or for all partitions if the argument topartitionsis null.default ElectPreferredLeadersResultelectPreferredLeaders(java.util.Collection<TopicPartition> partitions)Deprecated.Since 2.4.0.default ElectPreferredLeadersResultelectPreferredLeaders(java.util.Collection<TopicPartition> partitions, ElectPreferredLeadersOptions options)Deprecated.Since 2.4.0.default ExpireDelegationTokenResultexpireDelegationToken(byte[] hmac)Expire a Delegation Token.ExpireDelegationTokenResultexpireDelegationToken(byte[] hmac, ExpireDelegationTokenOptions options)Expire a Delegation Token.default AlterConfigsResultincrementalAlterConfigs(java.util.Map<ConfigResource,java.util.Collection<AlterConfigOp>> configs)This API is not supported.AlterConfigsResultincrementalAlterConfigs(java.util.Map<ConfigResource,java.util.Collection<AlterConfigOp>> configs, AlterConfigsOptions options)This API is not supported.default ListConsumerGroupOffsetsResultlistConsumerGroupOffsets(java.lang.String groupId)List the consumer group offsets available in the cluster with the default options.ListConsumerGroupOffsetsResultlistConsumerGroupOffsets(java.lang.String groupId, ListConsumerGroupOffsetsOptions options)List the consumer group offsets available in the cluster.default ListConsumerGroupsResultlistConsumerGroups()List the consumer groups available in the cluster with the default options.ListConsumerGroupsResultlistConsumerGroups(ListConsumerGroupsOptions options)List the consumer groups available in the cluster.default ListOffsetsResultlistOffsets(java.util.Map<TopicPartition,OffsetSpec> topicPartitionOffsets)List offset for the specified partitions and OffsetSpec.ListOffsetsResultlistOffsets(java.util.Map<TopicPartition,OffsetSpec> topicPartitionOffsets, ListOffsetsOptions options)List offset for the specified partitions.default ListPartitionReassignmentsResultlistPartitionReassignments()List all of the current partition reassignments This is a convenience method forlistPartitionReassignments(ListPartitionReassignmentsOptions)with default options.ListPartitionReassignmentsResultlistPartitionReassignments(java.util.Optional<java.util.Set<TopicPartition>> partitions, ListPartitionReassignmentsOptions options)default ListPartitionReassignmentsResultlistPartitionReassignments(java.util.Set<TopicPartition> partitions)List the current reassignments for the given partitions This is a convenience method forlistPartitionReassignments(Set, ListPartitionReassignmentsOptions)with default options.default ListPartitionReassignmentsResultlistPartitionReassignments(java.util.Set<TopicPartition> partitions, ListPartitionReassignmentsOptions options)List the current reassignments for the given partitionsdefault ListPartitionReassignmentsResultlistPartitionReassignments(ListPartitionReassignmentsOptions options)List all of the current partition reassignmentsdefault ListTopicsResultlistTopics()List the topics available in the default stream with the default options.default ListTopicsResultlistTopics(java.lang.String streamPath)List the topics available in the specified stream with the default options.ListTopicsResultlistTopics(java.lang.String streamPath, ListTopicsOptions options)List the topics available in the specified stream.ListTopicsResultlistTopics(ListTopicsOptions options)List the topics available in the default stream.java.util.Map<MetricName,? extends Metric>metrics()Get the metrics kept by the adminClientRemoveMembersFromConsumerGroupResultremoveMembersFromConsumerGroup(java.lang.String groupId, RemoveMembersFromConsumerGroupOptions options)Remove members from the consumer group by given member identities.default RenewDelegationTokenResultrenewDelegationToken(byte[] hmac)Renew a Delegation Token.RenewDelegationTokenResultrenewDelegationToken(byte[] hmac, RenewDelegationTokenOptions options)Renew a Delegation Token.
-
-
-
Method Detail
-
create
static Admin create(java.util.Properties props)
Create a new Admin with the given configuration.- Parameters:
props- The configuration.- Returns:
- The new KafkaAdminClient.
-
create
static Admin create(java.util.Map<java.lang.String,java.lang.Object> conf)
Create a new Admin with the given configuration.- Parameters:
conf- The configuration.- Returns:
- The new KafkaAdminClient.
-
close
default void close()
Close the Admin and release all associated resources.- Specified by:
closein interfacejava.lang.AutoCloseable
-
close
@Deprecated default void close(long duration, java.util.concurrent.TimeUnit unit)Deprecated.Since 2.2. Useclose(Duration)orclose().Close the Admin 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 and time unit. 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.- Parameters:
duration- The duration to use for the wait time.unit- The time unit to use for the wait time.
-
close
void close(java.time.Duration timeout)
Close 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.- Parameters:
timeout- The time to use for the wait time.
-
createTopics
default CreateTopicsResult createTopics(java.util.Collection<NewTopic> newTopics)
Create a batch of new topics with the default options.This is a convenience method for
createTopics(Collection, CreateTopicsOptions)with default options. See the overload for more details.This operation is supported by brokers with version 0.10.1.0 or higher.
- Parameters:
newTopics- The new topics to create.- Returns:
- The CreateTopicsResult.
-
createTopics
CreateTopicsResult createTopics(java.util.Collection<NewTopic> newTopics, CreateTopicsOptions options)
Create 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,listTopics()anddescribeTopics(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.
- Parameters:
newTopics- The new topics to create.options- The options to use when creating the new topics.- Returns:
- The CreateTopicsResult.
-
deleteTopics
default DeleteTopicsResult deleteTopics(java.util.Collection<java.lang.String> topics)
This is a convenience method fordeleteTopics(Collection, DeleteTopicsOptions)with default options. See the overload for more details.This operation is supported by brokers with version 0.10.1.0 or higher.
- Parameters:
topics- The topic names to delete.- Returns:
- The DeleteTopicsResult.
-
deleteTopics
DeleteTopicsResult deleteTopics(java.util.Collection<java.lang.String> topics, DeleteTopicsOptions options)
Delete 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,listTopics()anddescribeTopics(Collection)may continue to return information about the deleted topics.If delete.topic.enable is false on the brokers, deleteTopics will mark the topics for deletion, but not actually delete them. The futures will return successfully in this case.
This operation is supported by brokers with version 0.10.1.0 or higher.
- Parameters:
topics- The topic names to delete.options- The options to use when deleting the topics.- Returns:
- The DeleteTopicsResult.
-
listTopics
default ListTopicsResult listTopics()
List the topics available in the default stream with the default options.This is a convenience method for
listTopics(ListTopicsOptions)with default options. See the overload for more details.- Returns:
- The ListTopicsResult.
-
listTopics
ListTopicsResult listTopics(ListTopicsOptions options)
List the topics available in the default stream.- Parameters:
options- The options to use when listing the topics.- Returns:
- The ListTopicsResult.
-
listTopics
default ListTopicsResult listTopics(java.lang.String streamPath)
List the topics available in the specified stream with the default options. This is a convenience method for #listTopics(ListTopicsOptions)with default options. See the overload for more details.- Parameters:
streamPath- The name of the stream for which the topics should be listed- Returns:
- The ListTopicsResult.
-
listTopics
ListTopicsResult listTopics(java.lang.String streamPath, ListTopicsOptions options)
List the topics available in the specified stream.- Parameters:
streamPath- The name of the stream for which the topics should be listedoptions- The options to use when listing the topics.- Returns:
- The ListTopicsResult.
-
describeTopics
default DescribeTopicsResult describeTopics(java.util.Collection<java.lang.String> topicNames)
Describe some topics in the cluster, with the default options.This is a convenience method for
describeTopics(Collection, DescribeTopicsOptions)with default options. See the overload for more details.- Parameters:
topicNames- The names of the topics to describe.- Returns:
- The DescribeTopicsResult.
-
describeTopics
DescribeTopicsResult describeTopics(java.util.Collection<java.lang.String> topicNames, DescribeTopicsOptions options)
Describe some topics in the cluster.- Parameters:
topicNames- The names of the topics to describe.options- The options to use when describing the topic.- Returns:
- The DescribeTopicsResult.
-
describeCluster
default DescribeClusterResult describeCluster()
Get information about the nodes in the cluster, using the default options.This is a convenience method for
describeCluster(DescribeClusterOptions)with default options. See the overload for more details.- Returns:
- The DescribeClusterResult.
-
describeCluster
DescribeClusterResult describeCluster(DescribeClusterOptions options)
Get information about the nodes in the cluster.- Parameters:
options- The options to use when getting information about the cluster.- Returns:
- The DescribeClusterResult.
-
describeAcls
default DescribeAclsResult describeAcls(AclBindingFilter filter)
This API is not supported. This is a convenience method fordescribeAcls(AclBindingFilter, DescribeAclsOptions)with default options. See the overload for more details.This operation is supported by brokers with version 0.11.0.0 or higher.
- Parameters:
filter- The filter to use.- Returns:
- The DeleteAclsResult.
-
describeAcls
DescribeAclsResult describeAcls(AclBindingFilter filter, DescribeAclsOptions options)
This API is not supported. Lists 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.
- Parameters:
filter- The filter to use.options- The options to use when listing the ACLs.- Returns:
- The DeleteAclsResult.
-
createAcls
default CreateAclsResult createAcls(java.util.Collection<AclBinding> acls)
This API is not supported. This is a convenience method forcreateAcls(Collection, CreateAclsOptions)with default options. See the overload for more details.This operation is supported by brokers with version 0.11.0.0 or higher.
- Parameters:
acls- The ACLs to create- Returns:
- The CreateAclsResult.
-
createAcls
CreateAclsResult createAcls(java.util.Collection<AclBinding> acls, CreateAclsOptions options)
This API is not supported. Creates 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.
- Parameters:
acls- The ACLs to createoptions- The options to use when creating the ACLs.- Returns:
- The CreateAclsResult.
-
deleteAcls
default DeleteAclsResult deleteAcls(java.util.Collection<AclBindingFilter> filters)
This API is not supported. This is a convenience method fordeleteAcls(Collection, DeleteAclsOptions)with default options. See the overload for more details.This operation is supported by brokers with version 0.11.0.0 or higher.
- Parameters:
filters- The filters to use.- Returns:
- The DeleteAclsResult.
-
deleteAcls
DeleteAclsResult deleteAcls(java.util.Collection<AclBindingFilter> filters, DeleteAclsOptions options)
This API is not supported. Deletes 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.
- Parameters:
filters- The filters to use.options- The options to use when deleting the ACLs.- Returns:
- The DeleteAclsResult.
-
describeConfigs
default DescribeConfigsResult describeConfigs(java.util.Collection<ConfigResource> resources)
This API is not supported. Get the configuration for the specified resources with the default options.This is a convenience method for
describeConfigs(Collection, DescribeConfigsOptions)with default options. See the overload for more details.This operation is supported by brokers with version 0.11.0.0 or higher.
- Parameters:
resources- The resources (topic and broker resource types are currently supported)- Returns:
- The DescribeConfigsResult
-
describeConfigs
DescribeConfigsResult describeConfigs(java.util.Collection<ConfigResource> resources, DescribeConfigsOptions options)
This API is not supported. Get the configuration for the specified resources.The returned configuration includes default values and the isDefault() method can be used to distinguish them from user supplied values.
The value of config entries where isSensitive() is true is always
nullso that sensitive information is not disclosed.Config entries where isReadOnly() is true cannot be updated.
This operation is supported by brokers with version 0.11.0.0 or higher.
- Parameters:
resources- The resources (topic and broker resource types are currently supported)options- The options to use when describing configs- Returns:
- The DescribeConfigsResult
-
alterConfigs
@Deprecated default AlterConfigsResult alterConfigs(java.util.Map<ConfigResource,Config> configs)
Deprecated.Since 2.3. UseincrementalAlterConfigs(Map).This API is not supported. Update the configuration for the specified resources with the default options.This is a convenience method for
alterConfigs(Map, AlterConfigsOptions)with default options. See the overload for more details.This operation is supported by brokers with version 0.11.0.0 or higher.
- Parameters:
configs- The resources with their configs (topic is the only resource type with configs that can be updated currently)- Returns:
- The AlterConfigsResult
-
alterConfigs
@Deprecated AlterConfigsResult alterConfigs(java.util.Map<ConfigResource,Config> configs, AlterConfigsOptions options)
Deprecated.Since 2.3. UseincrementalAlterConfigs(Map, AlterConfigsOptions).This API is not supported. Update the configuration for the specified resources with the default options.Updates are not transactional so they may succeed for some resources while fail for others. The configs for a particular resource are updated atomically.
This operation is supported by brokers with version 0.11.0.0 or higher.
- Parameters:
configs- The resources with their configs (topic is the only resource type with configs that can be updated currently)options- The options to use when describing configs- Returns:
- The AlterConfigsResult
-
incrementalAlterConfigs
default AlterConfigsResult incrementalAlterConfigs(java.util.Map<ConfigResource,java.util.Collection<AlterConfigOp>> configs)
This API is not supported. Incrementally updates the configuration for the specified resources with default options.This is a convenience method for
incrementalAlterConfigs(Map, AlterConfigsOptions)with default options. See the overload for more details.This operation is supported by brokers with version 2.3.0 or higher.
- Parameters:
configs- The resources with their configs- Returns:
- The AlterConfigsResult
-
incrementalAlterConfigs
AlterConfigsResult incrementalAlterConfigs(java.util.Map<ConfigResource,java.util.Collection<AlterConfigOp>> configs, AlterConfigsOptions options)
This API is not supported. Incrementally 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.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.
- Parameters:
configs- The resources with their configsoptions- The options to use when altering configs- Returns:
- The AlterConfigsResult
-
alterReplicaLogDirs
default AlterReplicaLogDirsResult alterReplicaLogDirs(java.util.Map<TopicPartitionReplica,java.lang.String> replicaAssignment)
This API is not supported. Change the log directory for the specified replicas. If the replica does not exist on the broker, the result shows REPLICA_NOT_AVAILABLE for the given replica and the replica will be created in the given log directory on the broker when it is created later. If the replica already exists on the broker, the replica will be moved to the given log directory if it is not already there. For detailed result, inspect the returnedAlterReplicaLogDirsResultinstance.This operation is not transactional so it may succeed for some replicas while fail for others.
This is a convenience method for
alterReplicaLogDirs(Map, AlterReplicaLogDirsOptions)with default options. See the overload for more details.This operation is supported by brokers with version 1.1.0 or higher.
- Parameters:
replicaAssignment- The replicas with their log directory absolute path- Returns:
- The AlterReplicaLogDirsResult
- Throws:
java.lang.InterruptedException- Interrupted while joining I/O thread
-
alterReplicaLogDirs
AlterReplicaLogDirsResult alterReplicaLogDirs(java.util.Map<TopicPartitionReplica,java.lang.String> replicaAssignment, AlterReplicaLogDirsOptions options)
This API is not supported. Change the log directory for the specified replicas. If the replica does not exist on the broker, the result shows REPLICA_NOT_AVAILABLE for the given replica and the replica will be created in the given log directory on the broker when it is created later. If the replica already exists on the broker, the replica will be moved to the given log directory if it is not already there. For detailed result, inspect the 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.
- Parameters:
replicaAssignment- The replicas with their log directory absolute pathoptions- The options to use when changing replica dir- Returns:
- The AlterReplicaLogDirsResult
- Throws:
java.lang.InterruptedException- Interrupted while joining I/O thread
-
describeLogDirs
default DescribeLogDirsResult describeLogDirs(java.util.Collection<java.lang.Integer> brokers)
This API is not supported. Query the information of all log directories on the given set of brokersThis is a convenience method for
describeLogDirs(Collection, DescribeLogDirsOptions)with default options. See the overload for more details.This operation is supported by brokers with version 1.0.0 or higher.
- Parameters:
brokers- A list of brokers- Returns:
- The DescribeLogDirsResult
-
describeLogDirs
DescribeLogDirsResult describeLogDirs(java.util.Collection<java.lang.Integer> brokers, DescribeLogDirsOptions options)
This API is not supported. Query the information of all log directories on the given set of brokersThis operation is supported by brokers with version 1.0.0 or higher.
- Parameters:
brokers- A list of brokersoptions- The options to use when querying log dir info- Returns:
- The DescribeLogDirsResult
-
describeReplicaLogDirs
default DescribeReplicaLogDirsResult describeReplicaLogDirs(java.util.Collection<TopicPartitionReplica> replicas)
This API is not supported. Query the replica log directory information for the specified replicas.This is a convenience method for
describeReplicaLogDirs(Collection, DescribeReplicaLogDirsOptions)with default options. See the overload for more details.This operation is supported by brokers with version 1.0.0 or higher.
- Parameters:
replicas- The replicas to query- Returns:
- The DescribeReplicaLogDirsResult
-
describeReplicaLogDirs
DescribeReplicaLogDirsResult describeReplicaLogDirs(java.util.Collection<TopicPartitionReplica> replicas, DescribeReplicaLogDirsOptions options)
This API is not supported. Query the replica log directory information for the specified replicas.This operation is supported by brokers with version 1.0.0 or higher.
- Parameters:
replicas- The replicas to queryoptions- The options to use when querying replica log dir info- Returns:
- The DescribeReplicaLogDirsResult
-
createPartitions
default CreatePartitionsResult createPartitions(java.util.Map<java.lang.String,NewPartitions> newPartitions)
Increase 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 is a convenience method for
createPartitions(Map, CreatePartitionsOptions)with default options. See the overload for more details.- Parameters:
newPartitions- The topics which should have new partitions created, and corresponding parameters for the created partitions.- Returns:
- The CreatePartitionsResult.
-
createPartitions
CreatePartitionsResult createPartitions(java.util.Map<java.lang.String,NewPartitions> newPartitions, CreatePartitionsOptions options)
Increase 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,
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.
- 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
default DeleteRecordsResult deleteRecords(java.util.Map<TopicPartition,RecordsToDelete> recordsToDelete)
This API is not supported. Delete records whose offset is smaller than the given offset of the corresponding partition.This is a convenience method for
deleteRecords(Map, DeleteRecordsOptions)with default options. See the overload for more details.This operation is supported by brokers with version 0.11.0.0 or higher.
- Parameters:
recordsToDelete- The topic partitions and related offsets from which records deletion starts.- Returns:
- The DeleteRecordsResult.
-
deleteRecords
DeleteRecordsResult deleteRecords(java.util.Map<TopicPartition,RecordsToDelete> recordsToDelete, DeleteRecordsOptions options)
This API is not supported. Delete 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.
- 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
default CreateDelegationTokenResult createDelegationToken()
Create a Delegation Token.This is a convenience method for
createDelegationToken(CreateDelegationTokenOptions)with default options. See the overload for more details.- Returns:
- The CreateDelegationTokenResult.
-
createDelegationToken
CreateDelegationTokenResult createDelegationToken(CreateDelegationTokenOptions options)
Create 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().
- Parameters:
options- The options to use when creating delegation token.- Returns:
- The DeleteRecordsResult.
-
renewDelegationToken
default RenewDelegationTokenResult renewDelegationToken(byte[] hmac)
Renew a Delegation Token.This is a convenience method for
renewDelegationToken(byte[], RenewDelegationTokenOptions)with default options. See the overload for more details.- Parameters:
hmac- HMAC of the Delegation token- Returns:
- The RenewDelegationTokenResult.
-
renewDelegationToken
RenewDelegationTokenResult renewDelegationToken(byte[] hmac, RenewDelegationTokenOptions options)
Renew 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().
- Parameters:
hmac- HMAC of the Delegation tokenoptions- The options to use when renewing delegation token.- Returns:
- The RenewDelegationTokenResult.
-
expireDelegationToken
default ExpireDelegationTokenResult expireDelegationToken(byte[] hmac)
Expire a Delegation Token.This is a convenience method for
expireDelegationToken(byte[], ExpireDelegationTokenOptions)with default options. This will expire the token immediately. See the overload for more details.- Parameters:
hmac- HMAC of the Delegation token- Returns:
- The ExpireDelegationTokenResult.
-
expireDelegationToken
ExpireDelegationTokenResult expireDelegationToken(byte[] hmac, ExpireDelegationTokenOptions options)
Expire 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().
- Parameters:
hmac- HMAC of the Delegation tokenoptions- The options to use when expiring delegation token.- Returns:
- The ExpireDelegationTokenResult.
-
describeDelegationToken
default DescribeDelegationTokenResult describeDelegationToken()
Describe the Delegation Tokens.This is a convenience method for
describeDelegationToken(DescribeDelegationTokenOptions)with default options. This will return all the user owned tokens and tokens where user have Describe permission. See the overload for more details.- Returns:
- The DescribeDelegationTokenResult.
-
describeDelegationToken
DescribeDelegationTokenResult describeDelegationToken(DescribeDelegationTokenOptions options)
Describe 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().
- Parameters:
options- The options to use when describing delegation tokens.- Returns:
- The DescribeDelegationTokenResult.
-
describeConsumerGroups
DescribeConsumerGroupsResult describeConsumerGroups(java.util.Collection<java.lang.String> groupIds, DescribeConsumerGroupsOptions options)
Describe some group IDs in the cluster.- Parameters:
groupIds- The IDs of the groups to describe.options- The options to use when describing the groups.- Returns:
- The DescribeConsumerGroupResult.
-
describeConsumerGroups
default DescribeConsumerGroupsResult describeConsumerGroups(java.util.Collection<java.lang.String> groupIds)
Describe some group IDs in the cluster, with the default options.This is a convenience method for
describeConsumerGroups(Collection, DescribeConsumerGroupsOptions)with default options. See the overload for more details.- Parameters:
groupIds- The IDs of the groups to describe.- Returns:
- The DescribeConsumerGroupResult.
-
listConsumerGroups
ListConsumerGroupsResult listConsumerGroups(ListConsumerGroupsOptions options)
List the consumer groups available in the cluster.- Parameters:
options- The options to use when listing the consumer groups.- Returns:
- The ListGroupsResult.
-
listConsumerGroups
default ListConsumerGroupsResult listConsumerGroups()
List the consumer groups available in the cluster with the default options.This is a convenience method for
listConsumerGroups(ListConsumerGroupsOptions)with default options. See the overload for more details.- Returns:
- The ListGroupsResult.
-
listConsumerGroupOffsets
ListConsumerGroupOffsetsResult listConsumerGroupOffsets(java.lang.String groupId, ListConsumerGroupOffsetsOptions options)
List the consumer group offsets available in the cluster.- Parameters:
options- The options to use when listing the consumer group offsets.- Returns:
- The ListGroupOffsetsResult
-
listConsumerGroupOffsets
default ListConsumerGroupOffsetsResult listConsumerGroupOffsets(java.lang.String groupId)
List the consumer group offsets available in the cluster with the default options.This is a convenience method for
listConsumerGroupOffsets(String, ListConsumerGroupOffsetsOptions)with default options.- Returns:
- The ListGroupOffsetsResult.
-
deleteConsumerGroups
DeleteConsumerGroupsResult deleteConsumerGroups(java.util.Collection<java.lang.String> groupIds, DeleteConsumerGroupsOptions options)
Delete consumer groups from the cluster.- Parameters:
options- The options to use when deleting a consumer group.- Returns:
- The DeletConsumerGroupResult.
-
deleteConsumerGroups
default DeleteConsumerGroupsResult deleteConsumerGroups(java.util.Collection<java.lang.String> groupIds)
Delete consumer groups from the cluster with the default options.- Returns:
- The DeleteConsumerGroupResult.
-
deleteConsumerGroupOffsets
DeleteConsumerGroupOffsetsResult deleteConsumerGroupOffsets(java.lang.String groupId, java.util.Set<TopicPartition> partitions, DeleteConsumerGroupOffsetsOptions options)
Delete committed offsets for a set of partitions in a consumer group. This will succeed at the partition level only if the group is not actively subscribed to the corresponding topic.- Parameters:
options- The options to use when deleting offsets in a consumer group.- Returns:
- The DeleteConsumerGroupOffsetsResult.
-
deleteConsumerGroupOffsets
default DeleteConsumerGroupOffsetsResult deleteConsumerGroupOffsets(java.lang.String groupId, java.util.Set<TopicPartition> partitions)
Delete committed offsets for a set of partitions in a consumer group with the default options. This will succeed at the partition level only if the group is not actively subscribed to the corresponding topic.- Returns:
- The DeleteConsumerGroupOffsetsResult.
-
electPreferredLeaders
@Deprecated default ElectPreferredLeadersResult electPreferredLeaders(java.util.Collection<TopicPartition> partitions)
Deprecated.Since 2.4.0. UseelectLeaders(ElectionType, Set).Elect the preferred replica as leader for topic partitions.This is a convenience method for
electLeaders(ElectionType, Set, ElectLeadersOptions)with preferred election type and default options.This operation is supported by brokers with version 2.2.0 or higher.
- Parameters:
partitions- The partitions for which the preferred leader should be elected.- Returns:
- The ElectPreferredLeadersResult.
-
electPreferredLeaders
@Deprecated default ElectPreferredLeadersResult electPreferredLeaders(java.util.Collection<TopicPartition> partitions, ElectPreferredLeadersOptions options)
Deprecated.Since 2.4.0. UseelectLeaders(ElectionType, Set, ElectLeadersOptions).Elect the preferred replica as leader for topic partitions.This is a convenience method for
electLeaders(ElectionType, Set, ElectLeadersOptions)with preferred election type.This operation is supported by brokers with version 2.2.0 or higher.
- Parameters:
partitions- The partitions for which the preferred leader should be elected.options- The options to use when electing the preferred leaders.- Returns:
- The ElectPreferredLeadersResult.
-
electLeaders
default ElectLeadersResult electLeaders(ElectionType electionType, java.util.Set<TopicPartition> partitions)
Elect a replica as leader for topic partitions.This is a convenience method for
electLeaders(ElectionType, Set, ElectLeadersOptions)with default options.- Parameters:
electionType- The type of election to conduct.partitions- The topics and partitions for which to conduct elections.- Returns:
- The ElectLeadersResult.
-
electLeaders
ElectLeadersResult electLeaders(ElectionType electionType, java.util.Set<TopicPartition> partitions, ElectLeadersOptions options)
Elect 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,
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.
- Parameters:
electionType- The type of election to conduct.partitions- The topics and partitions for which to conduct elections.options- The options to use when electing the leaders.- Returns:
- The ElectLeadersResult.
-
alterPartitionReassignments
default AlterPartitionReassignmentsResult alterPartitionReassignments(java.util.Map<TopicPartition,java.util.Optional<NewPartitionReassignment>> reassignments)
Change the reassignments for one or more partitions. Providing an empty Optional (e.g viaOptional.empty()) willrevert the reassignment for the associated partition. This is a convenience method foralterPartitionReassignments(Map, AlterPartitionReassignmentsOptions)with default options. See the overload for more details.
-
alterPartitionReassignments
AlterPartitionReassignmentsResult alterPartitionReassignments(java.util.Map<TopicPartition,java.util.Optional<NewPartitionReassignment>> reassignments, AlterPartitionReassignmentsOptions options)
Change the reassignments for one or more partitions. Providing an empty Optional (e.g viaOptional.empty()) willrevert the reassignment for the associated partition.The following exceptions can be anticipated when calling
get()on the futures obtained from the returnedAlterPartitionReassignmentsResult:ClusterAuthorizationExceptionIf the authenticated user didn't have alter access to the cluster.UnknownTopicOrPartitionExceptionIf the topic or partition does not exist within the cluster.TimeoutExceptionif the request timed out before the controller could record the new assignments.InvalidReplicaAssignmentExceptionIf the specified assignment was not valid.NoReassignmentInProgressExceptionIf there was an attempt to cancel a reassignment for a partition which was not being reassigned.
- Parameters:
reassignments- The reassignments to add, modify, or remove. SeeNewPartitionReassignment.options- The options to use.- Returns:
- The result.
-
listPartitionReassignments
default ListPartitionReassignmentsResult listPartitionReassignments()
List all of the current partition reassignments This is a convenience method forlistPartitionReassignments(ListPartitionReassignmentsOptions)with default options. See the overload for more details.
-
listPartitionReassignments
default ListPartitionReassignmentsResult listPartitionReassignments(java.util.Set<TopicPartition> partitions)
List the current reassignments for the given partitions This is a convenience method forlistPartitionReassignments(Set, ListPartitionReassignmentsOptions)with default options. See the overload for more details.
-
listPartitionReassignments
default ListPartitionReassignmentsResult listPartitionReassignments(java.util.Set<TopicPartition> partitions, ListPartitionReassignmentsOptions options)
List the current reassignments for the given partitionsThe following exceptions can be anticipated when calling
get()on the futures obtained from the returnedListPartitionReassignmentsResult:ClusterAuthorizationExceptionIf the authenticated user doesn't have alter access to the cluster.UnknownTopicOrPartitionExceptionIf a given topic or partition does not exist.TimeoutExceptionIf the request timed out before the controller could list the current reassignments.
- Parameters:
partitions- The topic partitions to list reassignments for.options- The options to use.- Returns:
- The result.
-
listPartitionReassignments
default ListPartitionReassignmentsResult listPartitionReassignments(ListPartitionReassignmentsOptions options)
List all of the current partition reassignmentsThe following exceptions can be anticipated when calling
get()on the futures obtained from the returnedListPartitionReassignmentsResult:ClusterAuthorizationExceptionIf the authenticated user doesn't have alter access to the cluster.UnknownTopicOrPartitionExceptionIf a given topic or partition does not exist.TimeoutExceptionIf the request timed out before the controller could list the current reassignments.
- Parameters:
options- The options to use.- Returns:
- The result.
-
listPartitionReassignments
ListPartitionReassignmentsResult listPartitionReassignments(java.util.Optional<java.util.Set<TopicPartition>> partitions, ListPartitionReassignmentsOptions options)
- 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.
-
removeMembersFromConsumerGroup
RemoveMembersFromConsumerGroupResult removeMembersFromConsumerGroup(java.lang.String groupId, RemoveMembersFromConsumerGroupOptions options)
Remove members from the consumer group by given member identities.For possible error codes, refer to
LeaveGroupResponse.- Parameters:
groupId- The ID of the group to remove member from.options- The options to carry removing members' information.- Returns:
- The MembershipChangeResult.
-
alterConsumerGroupOffsets
default AlterConsumerGroupOffsetsResult alterConsumerGroupOffsets(java.lang.String groupId, java.util.Map<TopicPartition,OffsetAndMetadata> offsets)
Alters offsets for the specified group. In order to succeed, the group must be empty.
This is a convenience method for
alterConsumerGroupOffsets(String, Map, AlterConsumerGroupOffsetsOptions)with default options. See the overload for more details.- Parameters:
groupId- The group for which to alter offsets.offsets- A map of offsets by partition with associated metadata.- Returns:
- The AlterOffsetsResult.
-
alterConsumerGroupOffsets
AlterConsumerGroupOffsetsResult alterConsumerGroupOffsets(java.lang.String groupId, java.util.Map<TopicPartition,OffsetAndMetadata> offsets, AlterConsumerGroupOffsetsOptions options)
Alters 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.
- 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
default ListOffsetsResult listOffsets(java.util.Map<TopicPartition,OffsetSpec> topicPartitionOffsets)
List offset for the specified partitions and OffsetSpec. WARNING: in mapr-kafka offset spec is ignored. This method returns only end offset regardless of offset spec.
This is a convenience method for
listOffsets(Map, ListOffsetsOptions)- Parameters:
topicPartitionOffsets- The mapping from partition to the OffsetSpec to look up.- Returns:
- The ListOffsetsResult.
-
listOffsets
ListOffsetsResult listOffsets(java.util.Map<TopicPartition,OffsetSpec> topicPartitionOffsets, ListOffsetsOptions options)
List offset for the specified partitions. WARNING: in mapr-kafka offset spec is ignored. This method returns only end offset regardless of offset spec.
- 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
default DescribeClientQuotasResult describeClientQuotas(org.apache.kafka.common.quota.ClientQuotaFilter filter)
Describes all entities matching the provided filter that have at least one client quota configuration value defined.This is a convenience method for
describeClientQuotas(ClientQuotaFilter, DescribeClientQuotasOptions)with default options. See the overload for more details.This operation is supported by brokers with version 2.6.0 or higher.
- Parameters:
filter- the filter to apply to match entities- Returns:
- the DescribeClientQuotasResult containing the result
-
describeClientQuotas
DescribeClientQuotasResult describeClientQuotas(org.apache.kafka.common.quota.ClientQuotaFilter filter, DescribeClientQuotasOptions options)
Describes 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.
- Parameters:
filter- the filter to apply to match entitiesoptions- the options to use- Returns:
- the DescribeClientQuotasResult containing the result
-
alterClientQuotas
default AlterClientQuotasResult alterClientQuotas(java.util.Collection<org.apache.kafka.common.quota.ClientQuotaAlteration> entries)
Alters client quota configurations with the specified alterations.This is a convenience method for
alterClientQuotas(Collection, AlterClientQuotasOptions)with default options. See the overload for more details.This operation is supported by brokers with version 2.6.0 or higher.
- Parameters:
entries- the alterations to perform- Returns:
- the AlterClientQuotasResult containing the result
-
alterClientQuotas
AlterClientQuotasResult alterClientQuotas(java.util.Collection<org.apache.kafka.common.quota.ClientQuotaAlteration> entries, AlterClientQuotasOptions options)
Alters 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.
- Parameters:
entries- the alterations to perform- Returns:
- the AlterClientQuotasResult containing the result
-
metrics
java.util.Map<MetricName,? extends Metric> metrics()
Get the metrics kept by the adminClient
-
-