1717
1818package kafka .admin
1919
20- import java .nio .charset .StandardCharsets
21- import java .util .concurrent .{ExecutionException , TimeUnit }
22- import java .util .{Collections , Properties }
2320import joptsimple ._
2421import kafka .server .DynamicConfig
2522import kafka .utils .Implicits ._
@@ -32,13 +29,18 @@ import org.apache.kafka.common.protocol.ApiKeys
3229import org .apache .kafka .common .quota .{ClientQuotaAlteration , ClientQuotaEntity , ClientQuotaFilter , ClientQuotaFilterComponent }
3330import org .apache .kafka .common .security .scram .internals .ScramMechanism
3431import org .apache .kafka .common .utils .{Exit , Utils }
32+ import org .apache .kafka .coordinator .group .GroupConfig
3533import org .apache .kafka .server .config .{ConfigType , QuotaConfig }
34+ import org .apache .kafka .server .metrics .ClientMetricsConfigs
3635import org .apache .kafka .server .util .{CommandDefaultOptions , CommandLineUtils }
3736import org .apache .kafka .storage .internals .log .LogConfig
3837
3938import java .net .{InetAddress , UnknownHostException }
40- import scala .jdk .CollectionConverters ._
39+ import java .nio .charset .StandardCharsets
40+ import java .util .concurrent .{ExecutionException , TimeUnit }
41+ import java .util .{Collections , Properties }
4142import scala .collection ._
43+ import scala .jdk .CollectionConverters ._
4244
4345/**
4446 * This script can be used to change configs for topics/clients/users/brokers/ips/client-metrics/groups dynamically
@@ -250,7 +252,7 @@ object ConfigCommand extends Logging {
250252 }
251253
252254 case IpType =>
253- val unknownConfigs = (configsToBeAdded.keys ++ configsToBeDeleted).filterNot(key => DynamicConfig . Ip .names.contains(key))
255+ val unknownConfigs = (configsToBeAdded.keys ++ configsToBeDeleted).filterNot(key => QuotaConfig .ipConfigs .names.contains(key))
254256 if (unknownConfigs.nonEmpty)
255257 throw new IllegalArgumentException (s " Only connection quota configs can be added for ' $IpType' using --bootstrap-server. Unexpected config names: ${unknownConfigs.mkString(" ," )}" )
256258 alterQuotaConfigs(adminClient, entityTypes, entityNames, configsToBeAddedMap, configsToBeDeleted)
@@ -529,11 +531,11 @@ object ConfigCommand extends Logging {
529531 val addConfig : OptionSpec [String ] = parser.accepts(" add-config" , " Key Value pairs of configs to add. Square brackets can be used to group values which contain commas: 'k1=v1,k2=[v1,v2,v2],k3=v3'. The following is a list of valid configurations: " +
530532 " For entity-type '" + TopicType + " ': " + LogConfig .configNames.asScala.map(" \t " + _).mkString(nl, nl, nl) +
531533 " For entity-type '" + BrokerType + " ': " + DynamicConfig .Broker .names.asScala.toSeq.sorted.map(" \t " + _).mkString(nl, nl, nl) +
532- " For entity-type '" + UserType + " ': " + DynamicConfig . User .names.asScala.toSeq.sorted.map(" \t " + _).mkString(nl, nl, nl) +
533- " For entity-type '" + ClientType + " ': " + DynamicConfig . Client .names.asScala.toSeq.sorted.map(" \t " + _).mkString(nl, nl, nl) +
534- " For entity-type '" + IpType + " ': " + DynamicConfig . Ip .names.asScala.toSeq.sorted.map(" \t " + _).mkString(nl, nl, nl) +
535- " For entity-type '" + ClientMetricsType + " ': " + DynamicConfig . ClientMetrics .names.asScala.toSeq.sorted.map(" \t " + _).mkString(nl, nl, nl) +
536- " For entity-type '" + GroupType + " ': " + DynamicConfig . Group .names.asScala.toSeq.sorted.map(" \t " + _).mkString(nl, nl, nl) +
534+ " For entity-type '" + UserType + " ': " + QuotaConfig .scramMechanismsPlusUserAndClientQuotaConfigs() .names.asScala.toSeq.sorted.map(" \t " + _).mkString(nl, nl, nl) +
535+ " For entity-type '" + ClientType + " ': " + QuotaConfig .userAndClientQuotaConfigs() .names.asScala.toSeq.sorted.map(" \t " + _).mkString(nl, nl, nl) +
536+ " For entity-type '" + IpType + " ': " + QuotaConfig .ipConfigs .names.asScala.toSeq.sorted.map(" \t " + _).mkString(nl, nl, nl) +
537+ " For entity-type '" + ClientMetricsType + " ': " + ClientMetricsConfigs .configDef() .names.asScala.toSeq.sorted.map(" \t " + _).mkString(nl, nl, nl) +
538+ " For entity-type '" + GroupType + " ': " + GroupConfig .configDef() .names.asScala.toSeq.sorted.map(" \t " + _).mkString(nl, nl, nl) +
537539 s " Entity types ' $UserType' and ' $ClientType' may be specified together to update config for clients of a specific user. " )
538540 .withRequiredArg
539541 .ofType(classOf [String ])
0 commit comments