jojochuang commented on code in PR #6614:
URL: https://github.com/apache/ozone/pull/6614#discussion_r1594856771


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneClientUtils.java:
##########
@@ -270,14 +269,14 @@ public static int limitValue(int confValue, String 
confName, int maxLimit) {
   }
 
   public static void deleteSnapshot(ObjectStore objectStore,
-      String snapshot, OFSPath snapPath) {
+                                    String snapshot, String volumeName, String 
bucketName) {

Review Comment:
   ```suggestion
         String snapshot, String volumeName, String bucketName) {
   ```



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractOzoneFileSystemTest.java:
##########
@@ -2154,4 +2154,30 @@ private void assertCounter(long value, String key) {
     assertEquals(value, statistics.getLong(key).longValue());
   }
 
+  @Test
+  void testSnapshotRead() throws Exception {
+    // Init data
+    Path snapPath1 = fs.createSnapshot(new Path("/"), "snap1");
+
+    Path file1 = new Path("/key1");
+    Path file2 = new Path("/key2");
+    ContractTestUtils.touch(fs, file1);
+    ContractTestUtils.touch(fs, file2);
+    Path snapPath2 = fs.createSnapshot(new Path("/"), "snap2");
+
+    Path file3 = new Path("/key3");
+    ContractTestUtils.touch(fs, file3);
+    Path snapPath3 = fs.createSnapshot(new Path("/"), "snap3");
+
+    try {
+      FileStatus[] f1 = fs.listStatus(snapPath1);
+      FileStatus[] f2 = fs.listStatus(snapPath2);
+      FileStatus[] f3 = fs.listStatus(snapPath3);
+      assertEquals(0, f1.length);
+      assertEquals(2, f2.length);
+      assertEquals(3, f3.length);
+    } catch (Exception e) {
+      fail("Failed to read/list on snapshotPath, exception: " + e);
+    }

Review Comment:
   Just let it throw exception, don't catch it.
   ```suggestion
       FileStatus[] f1 = fs.listStatus(snapPath1);
       FileStatus[] f2 = fs.listStatus(snapPath2);
       FileStatus[] f3 = fs.listStatus(snapPath3);
       assertEquals(0, f1.length);
       assertEquals(2, f2.length);
       assertEquals(3, f3.length);
   ```



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