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


##########
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:
   @nandakumar131  The protocol from the client to the server is just to send 
the name and snapshot path: 
https://github.com/apache/ozone/blob/8565c86cfd851fdb5239bdbbecd9dbeebc246def/hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto#L1612-L1615
   
   Do you think it would be better for me to change the protocol to use send 
over the volume and bucket instead of the path?  Or should I send all three, 
volume, bucket, and path, (even though that is a bit redundant)?
   
   I'll also add validation of the volume and bucket names on the client side.
   



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