hemantk-12 commented on code in PR #5536:
URL: https://github.com/apache/ozone/pull/5536#discussion_r1380591158


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotDeleteRequest.java:
##########
@@ -161,14 +161,11 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
       if (!snapshotInfo.getSnapshotStatus().equals(

Review Comment:
   This `if` statement is not needed anymore. You can simplify it to
   ```
   if(SnapshotInfo.SnapshotStatus.SNAPSHOT_DELETED ==
         snapshotInfo.getSnapshotStatus()) {
     throw new OMException("Snapshot is already deleted. "
         + "Pending reclamation.", FILE_NOT_FOUND);
   }
   ```
   or merge above if to if/else if
   ```
   if (snapshotInfo == null) {
       // Snapshot does not exist
     throw new OMException("Snapshot does not exist", FILE_NOT_FOUND);
   } else if (SnapshotInfo.SnapshotStatus.SNAPSHOT_DELETED ==
         snapshotInfo.getSnapshotStatus()) {
     throw new OMException("Snapshot is already deleted. "
         + "Pending reclamation.", FILE_NOT_FOUND);
   }
   ```



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