You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "AnonHxy (via GitHub)" <gi...@apache.org> on 2023/09/22 06:19:34 UTC
[GitHub] [pulsar] AnonHxy commented on a diff in pull request #21232: [improve] [client] Merge lookup requests for the same topic
AnonHxy commented on code in PR #21232:
URL: https://github.com/apache/pulsar/pull/21232#discussion_r1333928866
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/BinaryProtoLookupService.java:
##########
@@ -92,15 +100,43 @@ public void updateServiceUrl(String serviceUrl) throws PulsarClientException {
* @return broker-socket-address that serves given topic
*/
public CompletableFuture<Pair<InetSocketAddress, InetSocketAddress>> getBroker(TopicName topicName) {
- return findBroker(serviceNameResolver.resolveHost(), false, topicName, 0);
+ final MutableObject<CompletableFuture> newFutureCreated = new MutableObject<>();
Review Comment:
Maybe a simple `CompletableFuture` is enough, e.g.:
```
CompletableFuture<Pair<InetSocketAddress, InetSocketAddress>> localFuture = null;
```
All the `newFutureCreated.getValue()` could be replaced by `localFuture`. It will helpful for jvm minor GC.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org