adoroszlai commented on code in PR #5841:
URL: https://github.com/apache/ozone/pull/5841#discussion_r1432910300


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/fsck/ContainerHealthTask.java:
##########
@@ -132,7 +133,21 @@ public void triggerContainerHealthCheck() {
               " process {} existing database records.",
           Time.monotonicNow() - start, existingCount);
       start = Time.monotonicNow();
-      final List<ContainerInfo> containers = containerManager.getContainers();
+      checkAndProcessContainers(unhealthyContainerStateStatsMap, start,
+          currentTime);
+      processedContainers.clear();
+    } finally {
+      lock.writeLock().unlock();
+    }
+  }
+
+  private void checkAndProcessContainers(
+      Map<UnHealthyContainerStates, Map<String, Long>>
+          unhealthyContainerStateStatsMap, long start, long currentTime) {

Review Comment:
   `start` should not be a parameter, it should be set at the start of each 
iteration.



##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/fsck/ContainerHealthTask.java:
##########
@@ -437,7 +454,7 @@ public static List<UnhealthyContainers> 
generateUnhealthyRecords(
 
       if (container.isUnderReplicated()
           && !recordForStateExists.contains(
-              UnHealthyContainerStates.UNDER_REPLICATED.toString())) {
+          UnHealthyContainerStates.UNDER_REPLICATED.toString())) {

Review Comment:
   nit: Please avoid unnecessary space changes.



##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/fsck/ContainerHealthTask.java:
##########
@@ -280,7 +297,7 @@ private long processExistingDBRecords(long currentTime,
   private void processContainer(ContainerInfo container, long currentTime,
                                 Map<UnHealthyContainerStates,
                                     Map<String, Long>>
-                                      unhealthyContainerStateStatsMap) {
+                                    unhealthyContainerStateStatsMap) {

Review Comment:
   nit: Please avoid unnecessary space changes.



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