aruraghuwanshi commented on code in PR #19114:
URL: https://github.com/apache/druid/pull/19114#discussion_r2914678686
##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManager.java:
##########
@@ -88,6 +90,37 @@ public Set<String> getSupervisorIds()
return supervisors.keySet();
}
+ @Override
+ public Collection<SupervisorStatsProvider.SupervisorStats>
getSupervisorStats()
+ {
+ List<SupervisorStatsProvider.SupervisorStats> stats = new ArrayList<>();
+ for (Map.Entry<String, Pair<Supervisor, SupervisorSpec>> entry :
supervisors.entrySet()) {
+ final String supervisorId = entry.getKey();
+ final Supervisor supervisor = entry.getValue().lhs;
+ final SupervisorSpec spec = entry.getValue().rhs;
+
+ SupervisorStateManager.State state = supervisor.getState();
+ String stateStr = state != null && state.getBasicState() != null
+ ? state.getBasicState().toString()
+ : "UNKNOWN";
+ String dataSource = DefaultQueryMetrics.getTableNamesAsString(
+ new HashSet<>(spec.getDataSources() != null ? spec.getDataSources()
: Collections.emptyList())
+ );
+ String stream = spec.getSource();
+ String detailedState = state != null ? state.toString() : null;
+
+ stats.add(new SupervisorStatsProvider.SupervisorStats(
+ supervisorId,
+ spec.getType(),
+ stateStr,
+ dataSource,
+ stream,
+ detailedState
+ ));
+ }
Review Comment:
Added necessary changes to cleanup those temporary variables in the latest
commit - didn't pull in the above due to a typo on "UNKOWN". But yeah, the
changes are in
--
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]