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


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskWithLegacy.java:
##########
@@ -206,12 +131,118 @@ public boolean processWithLegacy(OMUpdateEventBatch 
events) {
     return true;
   }
 
+  private void processWithFileSystemLayout(OmKeyInfo updatedKeyInfo,
+                                           OmKeyInfo oldKeyInfo,
+                                           OMDBUpdateEvent.OMDBUpdateAction 
action,
+                                           Map<Long, NSSummary> nsSummaryMap)
+      throws IOException {
+    setKeyParentID(updatedKeyInfo);
+
+    if (!updatedKeyInfo.getKeyName().endsWith(OM_KEY_PREFIX)) {
+      switch (action) {
+      case PUT:
+        handlePutKeyEvent(updatedKeyInfo, nsSummaryMap);
+        break;
+
+      case DELETE:
+        handleDeleteKeyEvent(updatedKeyInfo, nsSummaryMap);
+        break;
+
+      case UPDATE:
+        if (oldKeyInfo != null) {
+          setKeyParentID(oldKeyInfo);
+          handleDeleteKeyEvent(oldKeyInfo, nsSummaryMap);
+        } else {
+          LOG.warn("Update event does not have the old keyInfo for {}.",
+              updatedKeyInfo.getKeyName());
+        }
+        handlePutKeyEvent(updatedKeyInfo, nsSummaryMap);
+        break;
+
+      default:
+        LOG.debug("Skipping DB update event fir Key: {}", action);

Review Comment:
   Done!



##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskWithLegacy.java:
##########
@@ -206,12 +131,118 @@ public boolean processWithLegacy(OMUpdateEventBatch 
events) {
     return true;
   }
 
+  private void processWithFileSystemLayout(OmKeyInfo updatedKeyInfo,
+                                           OmKeyInfo oldKeyInfo,
+                                           OMDBUpdateEvent.OMDBUpdateAction 
action,
+                                           Map<Long, NSSummary> nsSummaryMap)
+      throws IOException {
+    setKeyParentID(updatedKeyInfo);
+
+    if (!updatedKeyInfo.getKeyName().endsWith(OM_KEY_PREFIX)) {
+      switch (action) {
+      case PUT:
+        handlePutKeyEvent(updatedKeyInfo, nsSummaryMap);
+        break;
+
+      case DELETE:
+        handleDeleteKeyEvent(updatedKeyInfo, nsSummaryMap);
+        break;
+
+      case UPDATE:
+        if (oldKeyInfo != null) {
+          setKeyParentID(oldKeyInfo);
+          handleDeleteKeyEvent(oldKeyInfo, nsSummaryMap);
+        } else {
+          LOG.warn("Update event does not have the old keyInfo for {}.",
+              updatedKeyInfo.getKeyName());
+        }
+        handlePutKeyEvent(updatedKeyInfo, nsSummaryMap);
+        break;
+
+      default:
+        LOG.debug("Skipping DB update event fir Key: {}", action);

Review Comment:
   Done!



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