sodonnel commented on code in PR #10084:
URL: https://github.com/apache/ozone/pull/10084#discussion_r3099198689
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/SCMNodeManager.java:
##########
@@ -1053,6 +1064,28 @@ public DatanodeInfo getDatanodeInfo(DatanodeDetails dn) {
}
}
+ @Override
+ public int getNumDatanodesFinalized() {
+ return datanodesFinalized.get();
+ }
+
+ private void updateDatanodesFinalizedCount(
+ LayoutVersionProto previous, LayoutVersionProto current) {
+ int previousValue = isDatanodeFinalized(previous) ? 1 : 0;
+ int currentValue = isDatanodeFinalized(current) ? 1 : 0;
+ if (previousValue != currentValue) {
+ datanodesFinalized.addAndGet(currentValue - previousValue);
+ }
+ }
+
+ private static boolean isDatanodeFinalized(LayoutVersionProto layoutVersion)
{
Review Comment:
You could make this public static and then re-use it in the NodeManager.java
class too.
--
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]