ArafatKhan2198 commented on code in PR #5517:
URL: https://github.com/apache/ozone/pull/5517#discussion_r1538687423
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/handlers/EntityHandler.java:
##########
@@ -256,7 +280,52 @@ public static String[] parseRequestPath(String path) {
return names;
}
- private static String normalizePath(String path) {
+ /**
+ * Splits an object store path into volume, bucket, and key name components.
+ *
+ * This method parses a path of the format "/volumeName/bucketName/keyName",
+ * including paths with additional '/' characters within the key name. It's
+ * designed for object store paths where the first three '/' characters
+ * separate the root, volume and bucket names from the key name.
+ *
+ * @param path The object store path to parse, starting with a slash.
+ * @return A String array with three elements: volume name, bucket name, and
+ * key name, or {null} if the path format is invalid.
+ */
+ public static String[] parseObjectStorePath(String path) {
Review Comment:
Done!
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java:
##########
@@ -743,6 +743,46 @@ public static String normalizeKey(String keyName,
return keyName;
}
+ /**
+ * Normalizes a given path up to the bucket level.
+ *
+ * This method takes a path as input and normalises uptil the bucket level.
+ * It handles empty, removes leading slashes, and splits the path into
+ * segments. It then extracts the volume and bucket names, forming a
+ * normalized path with a single slash. Finally, any remaining segments are
+ * joined as the key name, returning the complete standardized path.
+ *
+ * @param path The path string to be normalized.
+ * @return The normalized path string.
+ */
+ public static String normalizePathUptilBucket(String path) {
Review Comment:
No this normalisation method will not change the objectName structure. I
have added a unit test to verify it in the latest commit.
--
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]