smengcl commented on code in PR #4266:
URL: https://github.com/apache/ozone/pull/4266#discussion_r1107677926


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/FileSizeCountTask.java:
##########
@@ -122,28 +123,46 @@ public Pair<String, Boolean> process(OMUpdateEventBatch 
events) {
     final Collection<String> taskTables = getTaskTables();
 
     while (eventIterator.hasNext()) {
-      OMDBUpdateEvent<String, OmKeyInfo> omdbUpdateEvent = 
eventIterator.next();
+      OMDBUpdateEvent<String, ?> omdbUpdateEvent = eventIterator.next();
       // Filter event inside process method to avoid duping
       if (!taskTables.contains(omdbUpdateEvent.getTable())) {
         continue;
       }
       String updatedKey = omdbUpdateEvent.getKey();
-      OmKeyInfo omKeyInfo = omdbUpdateEvent.getValue();
+
+      // Get the updated and old OM Key Info objects
+      Object omKeyInfo = omdbUpdateEvent.getValue();
+      Object oldOmKeyInfo = omdbUpdateEvent.getOldValue();
+
+      OmKeyInfo keyInfo, oldKeyInfo;
+      // Handle the case where the updated OM Key Info is a RepeatedOmKeyInfo 
object
+      if (omKeyInfo instanceof RepeatedOmKeyInfo) {
+        // Handle RepeatedOmKeyInfo object
+        RepeatedOmKeyInfo repeatedKeyInfo = (RepeatedOmKeyInfo) omKeyInfo;
+        keyInfo = repeatedKeyInfo.getOmKeyInfoList().get(0);
+        oldKeyInfo = repeatedKeyInfo.getOmKeyInfoList().get(0);

Review Comment:
   @ArafatKhan2198 Looks like it is correctly limiting the events to `keyTable`.
   
   Then we need to find out how those `deletedTable` events could have gotten 
through this check in the first place.
   
   Any chance for a quick repro UT? Generate an event from `deletedTable` and 
see if the filter logic is working?



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