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:
https://github.com/apache/ozone/blob/194dbea5d9307a8580ae63f6a7f3c4244f20fdff/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/SnapshotInfo.java#L500-L501
--
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]