swamirishi commented on code in PR #5526:
URL: https://github.com/apache/ozone/pull/5526#discussion_r1379496714
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java:
##########
@@ -1350,47 +1356,56 @@ long generateDiffReport(
"Old and new key name both are null");
} else if (oldKeyName == null) { // Key Created.
String key = resolveBucketRelativePath(isFSOBucket,
- newParentIdPathMap, newKeyName);
- DiffReportEntry entry =
- SnapshotDiffReportOzone.getDiffReportEntry(CREATE, key);
- createDiffs.add(codecRegistry.asRawData(entry));
+ newParentIdPathMap, newKeyName, true);
+ if (key != null) {
+ DiffReportEntry entry =
+ SnapshotDiffReportOzone.getDiffReportEntry(CREATE, key);
+ createDiffs.add(codecRegistry.asRawData(entry));
+ }
} else if (newKeyName == null) { // Key Deleted.
String key = resolveBucketRelativePath(isFSOBucket,
- oldParentIdPathMap, oldKeyName);
+ oldParentIdPathMap, oldKeyName, false);
DiffReportEntry entry =
SnapshotDiffReportOzone.getDiffReportEntry(DELETE, key);
deleteDiffs.add(codecRegistry.asRawData(entry));
} else if (isDirectoryObject &&
Arrays.equals(oldKeyName, newKeyName)) {
String key = resolveBucketRelativePath(isFSOBucket,
- newParentIdPathMap, newKeyName);
- DiffReportEntry entry =
- SnapshotDiffReportOzone.getDiffReportEntry(MODIFY, key);
- modifyDiffs.add(codecRegistry.asRawData(entry));
+ newParentIdPathMap, newKeyName, true);
+ if (key != null) {
Review Comment:
yeah we can modify and delete the parent directory all together
--
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]