chia7712 commented on code in PR #21080:
URL: https://github.com/apache/kafka/pull/21080#discussion_r2956231905


##########
tools/src/main/java/org/apache/kafka/tools/BrokerApiVersionsCommand.java:
##########
@@ -182,6 +182,12 @@ static AdminClient create(AbstractConfig config) {
                     "admin",
                     ClientUtils.createChannelBuilder(config, time, logContext),
                     logContext);
+            NetworkClient.BootstrapConfiguration bootstrapConfiguration = new 
NetworkClient.BootstrapConfiguration(

Review Comment:
   Could you please add a static method enabled to avoid passing false? This 
would make it more readable and consistent.
   
   ```java
           private BootstrapConfiguration(final List<String> bootstrapServers,
                                         final ClientDnsLookup clientDnsLookup,
                                         final long bootstrapResolveTimeoutMs,
                                         final long retryBackoffMs,
                                         final boolean isBootstrapDisabled) {
               this.bootstrapServers = bootstrapServers;
               this.clientDnsLookup = clientDnsLookup;
               this.bootstrapResolveTimeoutMs = bootstrapResolveTimeoutMs;
               this.retryBackoffMs = retryBackoffMs;
               this.isBootstrapDisabled = isBootstrapDisabled;
           }
   
           public static BootstrapConfiguration enabled(final List<String> 
bootstrapServers,
                                                        final ClientDnsLookup 
clientDnsLookup,
                                                        final long 
bootstrapResolveTimeoutMs,
                                                        final long 
retryBackoffMs) {
               return new BootstrapConfiguration(bootstrapServers, 
clientDnsLookup, bootstrapResolveTimeoutMs, retryBackoffMs, true);
           }
   
           public static BootstrapConfiguration disabled() {
               return new BootstrapConfiguration(List.of(), null, 0, 0, true);
           }
   ``` 



##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/WorkerGroupMember.java:
##########
@@ -106,6 +107,11 @@ public WorkerGroupMember(DistributedConfig config,
             metadata.bootstrap(addresses);
             String metricGrpPrefix = "connect";
             ChannelBuilder channelBuilder = 
ClientUtils.createChannelBuilder(config, time, logContext);
+            NetworkClient.BootstrapConfiguration bootstrapConfiguration = new 
NetworkClient.BootstrapConfiguration(
+                config.getList(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG),
+                
ClientDnsLookup.forConfig(config.getString(CommonClientConfigs.CLIENT_DNS_LOOKUP_CONFIG)),
+                CommonClientConfigs.DEFAULT_BOOTSTRAP_RESOLVE_TIMEOUT_MS,

Review Comment:
   we should use `bootstrap.resolve.timeout.ms`, right?



##########
tools/src/main/java/org/apache/kafka/tools/BrokerApiVersionsCommand.java:
##########
@@ -182,6 +182,12 @@ static AdminClient create(AbstractConfig config) {
                     "admin",
                     ClientUtils.createChannelBuilder(config, time, logContext),
                     logContext);
+            NetworkClient.BootstrapConfiguration bootstrapConfiguration = new 
NetworkClient.BootstrapConfiguration(
+                config.getList(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG),
+                
ClientDnsLookup.forConfig(config.getString(CommonClientConfigs.CLIENT_DNS_LOOKUP_CONFIG)),
+                CommonClientConfigs.DEFAULT_BOOTSTRAP_RESOLVE_TIMEOUT_MS,

Review Comment:
   we should use `bootstrap.resolve.timeout.ms`, right?



##########
trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConnectionStressWorker.java:
##########
@@ -164,6 +166,12 @@ public boolean tryConnect() {
                 try (Metrics metrics = new Metrics()) {
                     try (Selector selector = new 
Selector(conf.getLong(AdminClientConfig.CONNECTIONS_MAX_IDLE_MS_CONFIG),
                         metrics, Time.SYSTEM, "", channelBuilder, logContext)) 
{
+                        NetworkClient.BootstrapConfiguration 
bootstrapConfiguration = new NetworkClient.BootstrapConfiguration(
+                            
conf.getList(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG),
+                            
ClientDnsLookup.forConfig(conf.getString(CommonClientConfigs.CLIENT_DNS_LOOKUP_CONFIG)),
+                            
CommonClientConfigs.DEFAULT_BOOTSTRAP_RESOLVE_TIMEOUT_MS,

Review Comment:
   we should use `bootstrap.resolve.timeout.ms`, right?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to