Skip to content

Commit a96b3be

Browse files
shreyas-devshreyas-dview
authored andcommitted
Pinot: Add configuration validation to prevent setting both broker-url and proxy.enabled
1 parent 2a0ff84 commit a96b3be

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/PinotConfig.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,4 +270,10 @@ public boolean allUrlSchemesEqual()
270270
.distinct()
271271
.count() == 1;
272272
}
273+
274+
@AssertTrue(message = "Invalid configuration: pinot.broker-url and pinot.proxy.enabled cannot both be set.")
275+
public boolean isValidBrokerProxyConfiguration()
276+
{
277+
return !(brokerUrl.isPresent() && proxyEnabled);
278+
}
273279
}

plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/client/PinotClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public PinotClient(
170170
asyncReloading(CacheLoader.from(this::getAllTables), executor));
171171
this.controllerAuthenticationProvider = controllerAuthenticationProvider;
172172
this.brokerAuthenticationProvider = brokerAuthenticationProvider;
173-
brokerHostAndPort = config.getBrokerUrl();
173+
this.brokerHostAndPort = config.getBrokerUrl();
174174
}
175175

176176
public static void addJsonBinders(JsonCodecBinder jsonCodecBinder)

0 commit comments

Comments
 (0)