sadanand48 commented on code in PR #5040:
URL: https://github.com/apache/ozone/pull/5040#discussion_r1260981779
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java:
##########
@@ -1318,11 +1316,21 @@ public void deleteSnapshot(String pathStr, String
snapshotName)
public SnapshotDiffReport getSnapshotDiffReport(Path snapshotDir,
String fromSnapshot, String toSnapshot)
throws IOException, InterruptedException {
- boolean takeTemporarySnapshot = false;
- if (toSnapshot.equals(ACTIVE_FS_SNAPSHOT_NAME)) {
- takeTemporarySnapshot = true;
+ boolean takeTemporaryToSnapshot = false;
+ boolean takeTemporaryFromSnapshot = false;
+ if (toSnapshot.isEmpty()) {
+ // empty toSnapshot implies diff b/w the fromSnapshot &
+ // current state.
+ takeTemporaryToSnapshot = true;
toSnapshot = createSnapshot(snapshotDir.toString(),
- "temp" + SnapshotInfo.generateName(Time.now()));
+ "temp" + "-to-" + SnapshotInfo.generateName(Time.now()));
+ }
+ if (fromSnapshot.isEmpty()) {
+ // empty fromSnapshot implies diff b/w the current state
+ // & the toSnapshot
+ takeTemporaryFromSnapshot = true;
+ fromSnapshot = createSnapshot(snapshotDir.toString(),
+ "temp" + "-from-" + SnapshotInfo.generateName(Time.now()));
Review Comment:
updated code using uuid now.
--
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]