devmadhuu commented on code in PR #7723:
URL: https://github.com/apache/ozone/pull/7723#discussion_r1948049960


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskDbEventHandler.java:
##########
@@ -210,21 +211,22 @@ protected void handleDeleteDirEvent(OmDirectoryInfo 
directoryInfo,
   protected boolean flushAndCommitNSToDB(Map<Long, NSSummary> nsSummaryMap) {
     try {
       writeNSSummariesToDB(nsSummaryMap);
-      nsSummaryMap.clear();
     } catch (IOException e) {
       LOG.error("Unable to write Namespace Summary data in Recon DB.", e);
       return false;
+    } finally {
+      nsSummaryMap.clear();
     }
     return true;
   }
 
-  protected boolean checkAndCallFlushToDB(
+/*  protected boolean checkAndCallFlushToDB(
       Map<Long, NSSummary> nsSummaryMap) {
     // if map contains more than entries, flush to DB and clear the map
     if (null != nsSummaryMap && nsSummaryMap.size() >=
         nsSummaryFlushToDBMaxThreshold) {
       return flushAndCommitNSToDB(nsSummaryMap);
     }
     return true;
-  }
+  }*/

Review Comment:
   Removed commented code. As discussed, we'll not be tracking metrics at event 
level and processing time of each task, we can already findout using existing 
metrics "lastUpdatedTimestamp" if we compute the difference between current and 
last run of task using Grafana/Prometheus.



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