smengcl commented on code in PR #4125:
URL: https://github.com/apache/ozone/pull/4125#discussion_r1094968495
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/OzoneAddress.java:
##########
@@ -343,6 +350,35 @@ public void ensureKeyAddress() throws OzoneClientException
{
}
}
+ /**
+ * Checking for a volume and a bucket
+ * but also accepting a snapshot
+ * indicator and a snapshot name.
+ * If the keyName can't be considered
+ * a valid snapshot, an exception is thrown.
+ *
+ * @throws OzoneClientException
+ */
+ public void ensureSnapshotAddress()
+ throws OzoneClientException {
+ if (keyName.length() > 0) {
+ if (OmUtils.isBucketSnapshotIndicator(keyName)) {
+ snapshotNameWithIndicator += keyName;
Review Comment:
Is there a reason to use `+=` instead of `=` here?
What if `ensureSnapshotAddress()` is called twice?
--
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]