Umeshkumar9414 commented on code in PR #8563:
URL: https://github.com/apache/hbase/pull/8563#discussion_r3951517561
##########
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:
Unsafe API used on a steady-state path (MetricsMasterWrapperImpl.java:195)
getOldestProcedureAgeByType() iterates
ProcedureExecutor.getActiveProceduresNoCopy(). That method's own javadoc:
"Should only be used when starting up, where the procedure workers have not
been started... Use getProcedures() ... for most cases."
--
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]