This is an automated email from the ASF dual-hosted git repository. yihua pushed a commit to branch release-0.15.0 in repository https://gitbox.apache.org/repos/asf/hudi.git
commit 670f13102f05f077adfc29892cbd199132c335ba Author: Y Ethan Guo <[email protected]> AuthorDate: Fri May 24 09:29:53 2024 -0700 [HUDI-7775] Remove unused APIs in HoodieStorage (#11281) --- .../java/org/apache/hudi/common/util/OrcUtils.java | 2 +- .../hudi/storage/hadoop/HoodieHadoopStorage.java | 11 --------- .../org/apache/hudi/storage/HoodieStorage.java | 27 ---------------------- .../hudi/io/storage/TestHoodieStorageBase.java | 9 -------- 4 files changed, 1 insertion(+), 48 deletions(-) diff --git a/hudi-hadoop-common/src/main/java/org/apache/hudi/common/util/OrcUtils.java b/hudi-hadoop-common/src/main/java/org/apache/hudi/common/util/OrcUtils.java index 8727ca5041d..03d72f4a97b 100644 --- a/hudi-hadoop-common/src/main/java/org/apache/hudi/common/util/OrcUtils.java +++ b/hudi-hadoop-common/src/main/java/org/apache/hudi/common/util/OrcUtils.java @@ -294,7 +294,7 @@ public class OrcUtils extends FileFormatUtils { // Since we are only interested in saving metadata to the footer, the schema, blocksizes and other // parameters are not important. Schema schema = HoodieAvroUtils.getRecordKeySchema(); - OrcFile.WriterOptions writerOptions = OrcFile.writerOptions(storage.unwrapConfAs(Configuration.class)) + OrcFile.WriterOptions writerOptions = OrcFile.writerOptions(storage.getConf().unwrapAs(Configuration.class)) .fileSystem((FileSystem) storage.getFileSystem()) .setSchema(AvroOrcUtils.createOrcSchema(schema)); try (Writer writer = OrcFile.createWriter(convertToHadoopPath(filePath), writerOptions)) { diff --git a/hudi-hadoop-common/src/main/java/org/apache/hudi/storage/hadoop/HoodieHadoopStorage.java b/hudi-hadoop-common/src/main/java/org/apache/hudi/storage/hadoop/HoodieHadoopStorage.java index 72262f6b5d4..f7df5e1f164 100644 --- a/hudi-hadoop-common/src/main/java/org/apache/hudi/storage/hadoop/HoodieHadoopStorage.java +++ b/hudi-hadoop-common/src/main/java/org/apache/hudi/storage/hadoop/HoodieHadoopStorage.java @@ -220,12 +220,6 @@ public class HoodieHadoopStorage extends HoodieStorage { return fs.delete(convertToHadoopPath(path), false); } - @Override - public StoragePath makeQualified(StoragePath path) { - return convertToStoragePath( - fs.makeQualified(convertToHadoopPath(path))); - } - @Override public Object getFileSystem() { return fs; @@ -236,11 +230,6 @@ public class HoodieHadoopStorage extends HoodieStorage { return new HadoopStorageConfiguration(fs.getConf()); } - @Override - public Configuration unwrapConf() { - return fs.getConf(); - } - @Override public HoodieStorage getRawStorage() { if (fs instanceof HoodieWrapperFileSystem) { diff --git a/hudi-io/src/main/java/org/apache/hudi/storage/HoodieStorage.java b/hudi-io/src/main/java/org/apache/hudi/storage/HoodieStorage.java index fcc8d2d505d..a92a2938bfc 100644 --- a/hudi-io/src/main/java/org/apache/hudi/storage/HoodieStorage.java +++ b/hudi-io/src/main/java/org/apache/hudi/storage/HoodieStorage.java @@ -39,8 +39,6 @@ import java.util.ArrayList; import java.util.List; import java.util.UUID; -import static org.apache.hudi.storage.StorageConfiguration.castConfiguration; - /** * Provides I/O APIs on files and directories on storage. * The APIs are mainly based on {@code org.apache.hadoop.fs.FileSystem} class. @@ -252,15 +250,6 @@ public abstract class HoodieStorage implements Closeable { @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING) public abstract boolean deleteFile(StoragePath path) throws IOException; - /** - * Qualifies a path to one which uses this storage and, if relative, made absolute. - * - * @param path to qualify. - * @return Qualified path. - */ - @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING) - public abstract StoragePath makeQualified(StoragePath path); - /** * @return the underlying file system instance if exists. */ @@ -273,12 +262,6 @@ public abstract class HoodieStorage implements Closeable { @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING) public abstract StorageConfiguration<?> getConf(); - /** - * @return the underlying configuration instance. - */ - @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING) - public abstract Object unwrapConf(); - /** * @return the raw storage. */ @@ -437,14 +420,4 @@ public abstract class HoodieStorage implements Closeable { public List<StoragePathInfo> globEntries(StoragePath pathPattern) throws IOException { return globEntries(pathPattern, e -> true); } - - /** - * @param clazz class of U. - * @param <U> type to return. - * @return the underlying configuration cast to type {@link U}. - */ - @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING) - public final <U> U unwrapConfAs(Class<U> clazz) { - return castConfiguration(unwrapConf(), clazz); - } } diff --git a/hudi-io/src/test/java/org/apache/hudi/io/storage/TestHoodieStorageBase.java b/hudi-io/src/test/java/org/apache/hudi/io/storage/TestHoodieStorageBase.java index cdc8d6f6746..c953fbab7a9 100644 --- a/hudi-io/src/test/java/org/apache/hudi/io/storage/TestHoodieStorageBase.java +++ b/hudi-io/src/test/java/org/apache/hudi/io/storage/TestHoodieStorageBase.java @@ -324,15 +324,6 @@ public abstract class TestHoodieStorageBase { assertFalse(storage.deleteDirectory(path2)); } - @Test - public void testMakeQualified() { - HoodieStorage storage = getStorage(); - StoragePath path = new StoragePath("/tmp/testMakeQualified/1.file"); - assertEquals( - new StoragePath("file:/tmp/testMakeQualified/1.file"), - storage.makeQualified(path)); - } - @Test public void testGetFileSystem() { Object conf = getConf();
