hemantk-12 commented on code in PR #5526:
URL: https://github.com/apache/ozone/pull/5526#discussion_r1379451902
##########
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:
Is it possible in case of Modify?
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshot.java:
##########
@@ -1063,6 +1063,44 @@ public void testSnapDiffWithDirectory() throws Exception
{
Assert.assertEquals(diff.getDiffList(), diffEntries);
}
+ /**
+ * Testing scenario:
+ * 1) Key k1 is created.
+ * 2) Snapshot snap1 created.
+ * 3) Dir dir1/dir2 is created.
+ * 4) Key k1 is renamed to key dir1/dir2/k1_renamed
+ * 5) Snapdiff b/w snapshot of Active FS & snap1 taken to assert difference
Review Comment:
nit:
```suggestion
* 5) Snapshot snap2 is created.
* 6) Snapdiff between snap2 & snap1 taken to assert difference
* of 3 key with 1 rename entry & 2 dirs create entry.
```
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/FSODirectoryPathResolver.java:
##########
@@ -71,7 +71,8 @@ private void addToPathMap(Pair<Long, Path> objectIDPath,
@SuppressFBWarnings("DMI_HARDCODED_ABSOLUTE_FILENAME")
@Override
public Map<Long, Path> getAbsolutePathForObjectIDs(
- Optional<Set<Long>> dirObjIds) throws IOException {
+ Optional<Set<Long>> dirObjIds, boolean skipUnresolvedObjs)
Review Comment:
Update and add `skipUnresolvedObjs` in java doc of
`getAbsolutePathForObjectIDs`.
--
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]