rhodo commented on code in PR #15722:
URL: https://github.com/apache/pinot/pull/15722#discussion_r2076585268
##########
pinot-server/src/main/java/org/apache/pinot/server/starter/helix/BaseServerStarter.java:
##########
@@ -1058,4 +1072,19 @@ private void initSegmentFetcher(PinotConfiguration
config)
protected AdminApiApplication createServerAdminApp() {
return new AdminApiApplication(_serverInstance, _accessControlFactory,
_serverConf);
}
+
+ private void refreshMessageCount() {
+ try {
+ HelixDataAccessor dataAccessor = _helixManager.getHelixDataAccessor();
+ List<String> children = dataAccessor.getBaseDataAccessor()
+ .getChildNames(String.format("/%s/INSTANCES/%s/MESSAGES",
_helixClusterName, _instanceId), 0);
+ _cachedMessageCount.set(children == null ? 0 : children.size());
+ } catch (Exception e) {
+ LOGGER.warn("Failed to get Helix message count", e);
+ _cachedMessageCount.set(0);
Review Comment:
yea good point, or maybe we can just retain the value from the previous
round — it might be stale, but that’s a reasonable fallback if we fail to fetch
the latest data.
--
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]