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


##########
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:
   @smengcl Don't you think this check would prevent the deleted table from 
being referenced? and it shouldn't be possible for RepeatedOmKeyInfo from ever 
being thrown up?  
https://github.com/apache/ozone/blob/59938f90bf035dde1285294d4103a49fb0840a8a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/FileSizeCountTask.java#L127



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