smengcl commented on code in PR #4134:
URL: https://github.com/apache/ozone/pull/4134#discussion_r1084631898


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OFSPath.java:
##########
@@ -263,6 +264,23 @@ public boolean isBucket() {
         !this.getVolumeName().isEmpty();
   }
 
+  /**
+   * If volume and bucket names are not empty and the key name
+   * only contains the snapshot indicator, then return true.
+   * e.g. /vol/bucket/.snapshot is a snapshot indicator.
+   */
+  public boolean isSnapshotIndicator() {
+    if (keyName.contains(OM_SNAPSHOT_INDICATOR)) {

Review Comment:
   I feel like we should check for key prefix (`OM_KEY_PREFIX + 
OM_SNAPSHOT_INDICATOR` ?) rather than `OM_SNAPSHOT_INDICATOR`.
   
   Because we are not preventing users from creating a regular key with 
`.snapshot` in its name?



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