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


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java:
##########
@@ -157,35 +166,32 @@ public Collection<String> getTaskTables() {
   @Override
   public Pair<String, Boolean> process(OMUpdateEventBatch events) {
     Iterator<OMDBUpdateEvent> eventIterator = events.getIterator();
-    // Initialize maps to store count and size information
-    HashMap<String, Long> objectCountMap = initializeCountMap();
-    HashMap<String, Long> unReplicatedSizeMap = initializeSizeMap(false);
-    HashMap<String, Long> replicatedSizeMap = initializeSizeMap(true);
-    final Collection<String> taskTables = getTaskTables();

Review Comment:
   As far as I understand, we call `process` only for delta OM DB updates to 
process and delta means , some DB updates have already been processed before by 
this background task, do repopulating these maps and collection from recon OM 
DB snapshot first time makes sense during `re-process` and not every time with 
`process`. so I don't see the reason to do initialisations of these maps or 
collection in every call to process because these maps are used in process to 
compute the value in memory and then write to DB. I am not sure why earlier 
these initialisations were there in each process call? @ArafatKhan2198 could 
know about this if he did these initialisations every time in `process` because 
of some other use case in his mind.



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