Copilot commented on code in PR #24790:
URL: https://github.com/apache/pulsar/pull/24790#discussion_r2384275248


##########
pulsar-common/src/test/java/org/apache/pulsar/common/util/netty/DnsResolverTest.java:
##########
@@ -31,6 +31,7 @@
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
+// This test needs to be run separately since it relies on static field values

Review Comment:
   The comment should explain why static field values require separate test 
execution and what potential issues could arise if run with other tests (e.g., 
test pollution, race conditions).
   ```suggestion
   // This test needs to be run separately because it manipulates static 
security properties
   // (networkaddress.cache.ttl and networkaddress.cache.negative.ttl), which 
are global to the JVM.
   // Running this test together with other tests can cause test pollution or 
race conditions,
   // leading to flaky or unreliable test results. To avoid these issues, this 
test must be executed in isolation.
   ```



##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientSharedResourcesBuilderImpl.java:
##########
@@ -0,0 +1,283 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.client.impl;
+
+import com.google.common.collect.Lists;
+import java.net.InetSocketAddress;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Consumer;
+import org.apache.pulsar.client.api.DnsResolverConfig;
+import org.apache.pulsar.client.api.EventLoopGroupConfig;
+import org.apache.pulsar.client.api.PulsarClientSharedResources;
+import org.apache.pulsar.client.api.PulsarClientSharedResourcesBuilder;
+import org.apache.pulsar.client.api.ThreadPoolConfig;
+import org.apache.pulsar.client.api.TimerConfig;
+import org.apache.pulsar.common.util.netty.DnsResolverUtil;
+
+public class PulsarClientSharedResourcesBuilderImpl implements 
PulsarClientSharedResourcesBuilder {
+    Set<PulsarClientSharedResources.SharedResource> sharedResources = new 
HashSet<>();
+    Map<PulsarClientSharedResources.SharedResource, ResourceConfig> 
resourceConfigs = new HashMap<>();
+    private boolean shareConfigured;
+

Review Comment:
   The empty ResourceConfig interface serves as a marker interface but lacks 
documentation. Consider adding a Javadoc comment explaining its purpose as a 
common type for configuration objects.
   ```suggestion
   
       /**
        * Marker interface for resource configuration objects used by shared 
resources.
        * Serves as a common type for various configuration implementations.
        */
   ```



##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/HttpLookupService.java:
##########
@@ -65,10 +68,17 @@ public class HttpLookupService implements LookupService {
     private final LatencyHistogram histoGetSchema;
     private final LatencyHistogram histoListTopics;
 
+    @Deprecated
     public HttpLookupService(InstrumentProvider instrumentProvider, 
ClientConfigurationData conf,
-                             EventLoopGroup eventLoopGroup)
+                             EventLoopGroup eventLoopGroup) throws 
PulsarClientException {
+        this(instrumentProvider, conf, eventLoopGroup, null, null);
+    }

Review Comment:
   The deprecated constructor should include a deprecation message explaining 
why it's deprecated and what alternative should be used, along with a removal 
target version.



-- 
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