xBis7 commented on code in PR #4164:
URL: https://github.com/apache/ozone/pull/4164#discussion_r1081158602


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -1623,6 +1629,51 @@ public void restart() throws IOException {
     omState = State.RUNNING;
   }
 
+  /**
+   * Iterate the Snapshot table, check the status
+   * for every snapshot and update OMMetrics.
+   */
+  private void updateActiveSnapshotMetrics()
+      throws IOException {
+
+    long activeGauge = 0;
+    long deletedGauge = 0;
+    long reclaimedGauge = 0;
+
+    try (TableIterator<String, ? extends
+        KeyValue<String, SnapshotInfo>> keyIter =
+             metadataManager.getSnapshotInfoTable().iterator()) {
+      Table.KeyValue<String, SnapshotInfo> keyValue;
+
+      List<SnapshotInfo> snapshotInfoList = new ArrayList<>();
+
+      while (keyIter.hasNext()) {
+        keyValue = keyIter.next();
+        snapshotInfoList.add(keyValue.getValue());
+      }
+
+      for (SnapshotInfo info : snapshotInfoList) {

Review Comment:
   You are right, this is unnecessary.



-- 
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]

Reply via email to