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 2021/02/18 23:43:59 UTC

[GitHub] [incubator-pinot] fx19880617 commented on a change in pull request #6586: Server `queriesDisabled` metric:

fx19880617 commented on a change in pull request #6586:
URL: https://github.com/apache/incubator-pinot/pull/6586#discussion_r578824199



##########
File path: pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotInstanceRestletResource.java
##########
@@ -104,19 +105,34 @@ public String getInstance(
     response.set("tags", JsonUtils.objectToJsonNode(instanceConfig.getTags()));
     response.set("pools", JsonUtils.objectToJsonNode(instanceConfig.getRecord().getMapField(InstanceUtils.POOL_KEY)));
     response.put("grpcPort", getGrpcPort(instanceConfig));
+    response.put("adminPort", getAdminPort(instanceConfig));
+    String queriesDisabled = instanceConfig.getRecord().getSimpleField(CommonConstants.Helix.QUERIES_DISABLED);
+    if ("true".equalsIgnoreCase(queriesDisabled)) {
+      response.put(CommonConstants.Helix.QUERIES_DISABLED, "true");
+    }
     return response.toString();
   }
 
   private int getGrpcPort(InstanceConfig instanceConfig) {
     int grpcPort;
     try {
-      grpcPort = Integer.parseInt(instanceConfig.getRecord().getSimpleField(InstanceUtils.GRPC_PORT_KEY));
+      grpcPort = Integer.parseInt(instanceConfig.getRecord().getSimpleField(CommonConstants.Helix.Instance.GRPC_PORT_KEY));
     } catch (Exception e) {
       grpcPort = Instance.NOT_SET_GRPC_PORT_VALUE;
     }
     return grpcPort;
   }
 
+  private int getAdminPort(InstanceConfig instanceConfig) {
+    int adminPort;
+    try {
+      adminPort = Integer.parseInt(instanceConfig.getRecord().getSimpleField(CommonConstants.Helix.Instance.ADMIN_PORT_KEY));
+    } catch (Exception e) {
+      adminPort = Instance.NOT_SET_ADMIN_PORT_VALUE;

Review comment:
       log this exception




----------------------------------------------------------------
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.

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