You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/08/08 20:43:51 UTC

[GitHub] [ozone] GeorgeJahad commented on a diff in pull request #3652: HDDS-6853. [Snapshot] Implement Create Snapshot API.

GeorgeJahad commented on code in PR #3652:
URL: https://github.com/apache/ozone/pull/3652#discussion_r940647389


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/SnapshotInfo.java:
##########
@@ -365,4 +391,144 @@ public static SnapshotInfo getFromProtobuf(
 
     return osib.build();
   }
+
+  /**
+   * Get volume from snapshot path.
+   */
+  private static String getVolumeNameFromPath(String path) {
+    String volumeName = null;
+    String[] names = path.split(OM_KEY_PREFIX);
+    if (names.length > 0) {
+      volumeName = names[0];
+    }
+    return volumeName;
+  }
+
+  /**
+   * Get bucket from snapshot path.
+   */
+  private static String getBucketNameFromPath(String path) {
+    String bucketName = null;
+    String[] names = path.split(OM_KEY_PREFIX);
+    if (names.length > 1) {
+      bucketName = names[1];
+    }
+    return bucketName;
+  }

Review Comment:
   These are the static methods that are used to set the volume and bucket names into the SnapshotInfo instance.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org