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


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskWithLegacy.java:
##########
@@ -87,10 +87,15 @@ public boolean processWithLegacy(OMUpdateEventBatch events) 
{
       String updatedKey = omdbUpdateEvent.getKey();
 
       try {
-        OMDBUpdateEvent<String, OmKeyInfo> keyTableUpdateEvent =
-            (OMDBUpdateEvent<String, OmKeyInfo>) omdbUpdateEvent;
-        OmKeyInfo updatedKeyInfo = keyTableUpdateEvent.getValue();
-        OmKeyInfo oldKeyInfo = keyTableUpdateEvent.getOldValue();
+        OMDBUpdateEvent<String, ?> keyTableUpdateEvent = omdbUpdateEvent;
+        Object value = keyTableUpdateEvent.getValue();
+        Object oldValue = keyTableUpdateEvent.getOldValue();
+        if (!(value instanceof OmKeyInfo)) {
+          LOG.debug("Unexpected value type for key. Skipping processing.");

Review Comment:
    Please add the unexpected value type,  and key info in the debug message, 
to facilitate easy future debug. 



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