hemantk-12 commented on code in PR #4677:
URL: https://github.com/apache/ozone/pull/4677#discussion_r1197115781
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotChainManager.java:
##########
@@ -499,23 +468,24 @@ public String nextPathSnapshot(String snapshotPath,
String snapshotID)
* @return String, snapshot UUID of previous snapshot in chain from
* snapshotID
*/
- public String previousPathSnapshot(String snapshotPath, String snapshotID)
- throws NoSuchElementException {
+ public String previousPathSnapshot(String snapshotPath, String snapshotID) {
if (!snapshotChainPath.containsKey(snapshotPath) ||
!snapshotChainPath.get(snapshotPath).containsKey(snapshotID)) {
- LOG.error("no snapshot for provided snapshotPath {} and "
- + " snapshotID {}", snapshotPath, snapshotID);
- throw new NoSuchElementException("No snapshot: " + snapshotID
- + " for snapshot path:" + snapshotPath);
+ LOG.error("No snapshot found for provided snapshotId: {} and " +
+ "snapshotPath: {}", snapshotID, snapshotPath);
+ throw new NoSuchElementException(String.format("SnapshotId: %s is not " +
+ "found in snapshot chain for snapshotPath: %s.", snapshotID,
+ snapshotPath));
}
if (snapshotChainPath
.get(snapshotPath)
.get(snapshotID)
.getPreviousSnapshotID() == null) {
- LOG.error("no preceeding snapshot for provided snapshotPath {}, "
- + "snapshotID {}", snapshotPath, snapshotID);
- throw new NoSuchElementException("no preceeding snapshot from: "
- + snapshotID + "for snapshot path:" + snapshotPath);
+ LOG.error("No preceding snapshot for provided snapshotId: {} and " +
+ "snapshotPath: {}", snapshotPath, snapshotID);
+ throw new NoSuchElementException(String.format("Ne preceding snapshot " +
Review Comment:
Thanks for detailed review @aswinshakil. Updated as suggested.
--
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]