You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/09/08 01:56:03 UTC

[GitHub] [pinot] xiangfu0 commented on a diff in pull request #9343: Allow hiding pinot broker swagger UI by config

xiangfu0 commented on code in PR #9343:
URL: https://github.com/apache/pinot/pull/9343#discussion_r965433524


##########
pinot-broker/src/main/java/org/apache/pinot/broker/broker/BrokerAdminApiApplication.java:
##########
@@ -100,7 +103,13 @@ public void start(List<ListenerConfig> listenerConfigs) {
     } catch (IOException e) {
       throw new RuntimeException("Failed to start http server", e);
     }
-    PinotReflectionUtils.runWithLock(this::setupSwagger);
+    PinotConfiguration brokerConf = (PinotConfiguration) getProperties().get(PINOT_CONFIGURATION);

Review Comment:
   Create a variable in constructor:
   `_swaggerBrokerEnabled = brokerConf.getProperty(CommonConstants.Broker.CONFIG_OF_SWAGGER_BROKER_ENABLED, CommonConstants.Broker.DEFAULT_SWAGGER_BROKER_ENABLED)`
   
   Then in start(...) just do 
   ```
   if (_swaggerBrokerEnabled) {
       PinotReflectionUtils.runWithLock(this::setupSwagger);
   } else {
       LOGGER.info("Hiding Swagger UI for Broker");
   ```



-- 
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@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org