Sigma-Ma commented on code in PR #8563:
URL: https://github.com/apache/hbase/pull/8563#discussion_r3953851169
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapperImpl.java:
##########
@@ -180,6 +184,23 @@ public long getNumWALFiles() {
return master.getNumWALFiles();
}
+ @Override
+ public Map<String, Long> getOldestProcedureAgeByType() {
+ ProcedureExecutor<MasterProcedureEnv> procedureExecutor =
master.getMasterProcedureExecutor();
+ if (procedureExecutor == null) {
+ return Collections.emptyMap();
+ }
+ long now = EnvironmentEdgeManager.currentTime();
+ Map<String, Long> oldestProcedureAgeByType = new HashMap<>();
+ for (Procedure<MasterProcedureEnv> procedure :
procedureExecutor.getActiveProceduresNoCopy()) {
Review Comment:
Thanks for catching this.
The metrics collection path runs after the procedure workers have started,
so getActiveProceduresNoCopy() isn't appropriate here. I've switched it to
getProcedures() and kept the isFinished() filter because the copied list also
contains retained completed procedures.
--
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]