17
17
18
18
package kafka .admin
19
19
20
- import java .nio .charset .StandardCharsets
21
- import java .util .concurrent .{ExecutionException , TimeUnit }
22
- import java .util .{Collections , Properties }
23
20
import joptsimple ._
24
21
import kafka .server .DynamicConfig
25
22
import kafka .utils .Implicits ._
@@ -32,13 +29,18 @@ import org.apache.kafka.common.protocol.ApiKeys
32
29
import org .apache .kafka .common .quota .{ClientQuotaAlteration , ClientQuotaEntity , ClientQuotaFilter , ClientQuotaFilterComponent }
33
30
import org .apache .kafka .common .security .scram .internals .ScramMechanism
34
31
import org .apache .kafka .common .utils .{Exit , Utils }
32
+ import org .apache .kafka .coordinator .group .GroupConfig
35
33
import org .apache .kafka .server .config .{ConfigType , QuotaConfig }
34
+ import org .apache .kafka .server .metrics .ClientMetricsConfigs
36
35
import org .apache .kafka .server .util .{CommandDefaultOptions , CommandLineUtils }
37
36
import org .apache .kafka .storage .internals .log .LogConfig
38
37
39
38
import 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 }
41
42
import scala .collection ._
43
+ import scala .jdk .CollectionConverters ._
42
44
43
45
/**
44
46
* 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 {
250
252
}
251
253
252
254
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))
254
256
if (unknownConfigs.nonEmpty)
255
257
throw new IllegalArgumentException (s " Only connection quota configs can be added for ' $IpType' using --bootstrap-server. Unexpected config names: ${unknownConfigs.mkString(" ," )}" )
256
258
alterQuotaConfigs(adminClient, entityTypes, entityNames, configsToBeAddedMap, configsToBeDeleted)
@@ -529,11 +531,11 @@ object ConfigCommand extends Logging {
529
531
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: " +
530
532
" For entity-type '" + TopicType + " ': " + LogConfig .configNames.asScala.map(" \t " + _).mkString(nl, nl, nl) +
531
533
" 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) +
537
539
s " Entity types ' $UserType' and ' $ClientType' may be specified together to update config for clients of a specific user. " )
538
540
.withRequiredArg
539
541
.ofType(classOf [String ])
0 commit comments