klsince commented on code in PR #16165:
URL: https://github.com/apache/pinot/pull/16165#discussion_r2162334771


##########
pinot-server/src/main/java/org/apache/pinot/server/api/resources/TablesResource.java:
##########
@@ -525,7 +532,27 @@ public ValidDocIdsBitmapResponse downloadValidDocIdsBitmap(
             String.format("Table %s segment %s is not a immutable segment", 
tableNameWithType, segmentName),
             Response.Status.BAD_REQUEST);
       }
-
+      ServiceStatus.Status status = 
ServiceStatus.getServiceStatus(_instanceId);
+      String serverStatus = "";
+      if (status.equals(ServiceStatus.Status.GOOD)) {
+        
_serverMetrics.addMeteredGlobalValue(ServerMeter.READINESS_CHECK_OK_CALLS, 1);
+        serverStatus = "OK";
+      } else {
+        serverStatus = "NOT_READY";
+      }
+      HelixAdmin helixAdmin = 
_serverInstance.getHelixManager().getClusterManagmentTool();
+      String helixClusterName = 
_serverInstance.getHelixManager().getClusterName();
+
+      TableViewsUtils.TableView externalView =
+          TableViewsUtils.getTableState(tableNameWithType, 
TableViewsUtils.EXTERNALVIEW, TableType.REALTIME, helixAdmin,
+              helixClusterName);
+      TableViewsUtils.TableView idealStateView =
+          TableViewsUtils.getTableState(tableNameWithType, 
TableViewsUtils.IDEALSTATE, TableType.REALTIME, helixAdmin,
+              helixClusterName);
+

Review Comment:
   It can be very costly to get both EV and IS when getting validDocIds for 
just one segment, considering this API can be called by many minion tasks 
around the same time, when executing tasks like compaction task



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to