lhotari commented on code in PR #21894:
URL: https://github.com/apache/pulsar/pull/21894#discussion_r1451783323
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/LeaderBroker.java:
##########
@@ -30,5 +30,23 @@
@AllArgsConstructor
@NoArgsConstructor
public class LeaderBroker {
+ private String lookupServiceAddress;
private String serviceUrl;
+
+ public String getLookupServiceAddress() {
+ if (lookupServiceAddress != null) {
+ return lookupServiceAddress;
+ } else {
+ // for backward compatibility at runtime with older versions of
Pulsar
+ return parseHostAndPort(serviceUrl);
+ }
+ }
+
+ private static String parseHostAndPort(String serviceUrl) {
+ int uriSeparatorPos = serviceUrl.indexOf("://");
+ if (uriSeparatorPos == -1) {
+ throw new IllegalArgumentException("'" + serviceUrl + "' isn't an
URI.");
+ }
+ return serviceUrl.substring(uriSeparatorPos + 3);
+ }
Review Comment:
This method was used in another class and I decided to keep it as-is. It's
something that could potentially be removed later when there's no need to
support mixed version clusters.
--
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]