You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "Technoboy- (via GitHub)" <gi...@apache.org> on 2023/07/24 08:06:17 UTC
[GitHub] [pulsar] Technoboy- commented on a diff in pull request #20821: [Enhancement] Verify at least one URL is present for cluster creation
Technoboy- commented on code in PR #20821:
URL: https://github.com/apache/pulsar/pull/20821#discussion_r1271894989
##########
pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/ClusterDataImpl.java:
##########
@@ -412,7 +412,20 @@ public ClusterDataImpl build() {
*
* @throws IllegalArgumentException exist illegal property.
*/
- public void checkPropertiesIfPresent() throws IllegalArgumentException {
+ public void checkPropertiesIfPresent() throws IllegalArgumentException {
+ boolean hasServiceUrl = getServiceUrl() != null;
+ boolean hasServiceUrlTls = getServiceUrlTls() != null;
+ boolean hasBrokerServiceUrl = getBrokerServiceUrl() != null;
+ boolean hasBrokerServiceUrlTls = getBrokerServiceUrlTls() != null;
+
+ if (!hasServiceUrl && !hasServiceUrlTls) {
+ throw new IllegalArgumentException("Atleast one of ServiceUrl or ServiceUrlTls must be set.");
Review Comment:
At least
##########
pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/ClusterDataImpl.java:
##########
@@ -412,7 +412,20 @@ public ClusterDataImpl build() {
*
* @throws IllegalArgumentException exist illegal property.
*/
- public void checkPropertiesIfPresent() throws IllegalArgumentException {
+ public void checkPropertiesIfPresent() throws IllegalArgumentException {
+ boolean hasServiceUrl = getServiceUrl() != null;
+ boolean hasServiceUrlTls = getServiceUrlTls() != null;
+ boolean hasBrokerServiceUrl = getBrokerServiceUrl() != null;
+ boolean hasBrokerServiceUrlTls = getBrokerServiceUrlTls() != null;
+
+ if (!hasServiceUrl && !hasServiceUrlTls) {
+ throw new IllegalArgumentException("Atleast one of ServiceUrl or ServiceUrlTls must be set.");
+ }
+
+ if (!hasBrokerServiceUrl && !hasBrokerServiceUrlTls) {
+ throw new IllegalArgumentException("Atleast one of BrokerServiceUrl or BrokerServiceUrlTls must be set.");
Review Comment:
At least
--
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