This is an automated email from the ASF dual-hosted git repository.

satish pushed a commit to branch release-0.12.2
in repository https://gitbox.apache.org/repos/asf/hudi.git

commit 9126df029b81a1abfdaf91e1937715521df69121
Author: Danny Chan <yuzhao....@gmail.com>
AuthorDate: Tue Nov 29 10:20:41 2022 +0800

    [HUDI-5286] UnsupportedOperationException throws when enabling filesystem 
retry (#7313)
---
 .../hudi/common/fs/HoodieRetryWrapperFileSystem.java       |  5 +++++
 .../hudi/common/fs/TestFSUtilsWithRetryWrapperEnable.java  | 14 ++++++++++++++
 2 files changed, 19 insertions(+)

diff --git 
a/hudi-common/src/main/java/org/apache/hudi/common/fs/HoodieRetryWrapperFileSystem.java
 
b/hudi-common/src/main/java/org/apache/hudi/common/fs/HoodieRetryWrapperFileSystem.java
index ed32eeee636..82ea10c459e 100644
--- 
a/hudi-common/src/main/java/org/apache/hudi/common/fs/HoodieRetryWrapperFileSystem.java
+++ 
b/hudi-common/src/main/java/org/apache/hudi/common/fs/HoodieRetryWrapperFileSystem.java
@@ -258,4 +258,9 @@ public class HoodieRetryWrapperFileSystem extends 
FileSystem {
   public Configuration getConf() {
     return fileSystem.getConf();
   }
+
+  @Override
+  public String getScheme() {
+    return fileSystem.getScheme();
+  }
 }
diff --git 
a/hudi-common/src/test/java/org/apache/hudi/common/fs/TestFSUtilsWithRetryWrapperEnable.java
 
b/hudi-common/src/test/java/org/apache/hudi/common/fs/TestFSUtilsWithRetryWrapperEnable.java
index 90e78bccbc5..149783ba416 100644
--- 
a/hudi-common/src/test/java/org/apache/hudi/common/fs/TestFSUtilsWithRetryWrapperEnable.java
+++ 
b/hudi-common/src/test/java/org/apache/hudi/common/fs/TestFSUtilsWithRetryWrapperEnable.java
@@ -37,6 +37,7 @@ import java.net.URI;
 import java.util.Arrays;
 import java.util.List;
 
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
 /**
@@ -78,6 +79,14 @@ public class TestFSUtilsWithRetryWrapperEnable extends 
TestFSUtils {
     folders.forEach(f -> assertThrows(RuntimeException.class, () -> 
metaClient.getFs().mkdirs(new Path(new Path(basePath), f))));
   }
 
+  @Test
+  public void testGetSchema() {
+    FakeRemoteFileSystem fakeFs = new 
FakeRemoteFileSystem(FSUtils.getFs(metaClient.getMetaPath(), 
metaClient.getHadoopConf()), 100);
+    FileSystem fileSystem = new HoodieRetryWrapperFileSystem(fakeFs, 
maxRetryIntervalMs, maxRetryNumbers, initialRetryIntervalMs, "");
+    HoodieWrapperFileSystem fs = new HoodieWrapperFileSystem(fileSystem, new 
NoOpConsistencyGuard());
+    assertDoesNotThrow(fs::getScheme, "Method #getSchema does not implement 
correctly");
+  }
+
   /**
    * Fake remote FileSystem which will throw RuntimeException something like 
AmazonS3Exception 503.
    */
@@ -204,5 +213,10 @@ public class TestFSUtilsWithRetryWrapperEnable extends 
TestFSUtils {
     public Configuration getConf() {
       return fs.getConf();
     }
+
+    @Override
+    public String getScheme() {
+      return fs.getScheme();
+    }
   }
 }

Reply via email to