KiteSoar opened a new pull request, #17661:
URL: https://github.com/apache/hudi/pull/17661

   ### Describe the issue this Pull Request addresses
   
   This PR refactors the codebase to use 
[HoodieStorageFactory](file:///Users/matthew/Desktop/Java%20Project/hudi/hudi-common/src/main/java/org/apache/hudi/storage/HoodieStorageFactory.java#L28-L76)
 instead of direct 
[HoodieHadoopStorage](file:///Users/matthew/Desktop/Java%20Project/hudi/hudi-hadoop-common/src/main/java/org/apache/hudi/storage/hadoop/HoodieHadoopStorage.java#L58-L305)
 instantiation, improving code maintainability and following the factory 
pattern design principle.
   
   ### Summary and Changelog
   
   **Summary:**
   Users and developers will benefit from a more maintainable and extensible 
storage layer architecture. The factory pattern allows for easier switching 
between different storage implementations in the future.
   
   **Changelog:**
   - Replaced ~20 direct `new HoodieHadoopStorage()` instantiations with 
[HoodieStorageFactory.getStorage()](file:///Users/matthew/Desktop/Java%20Project/hudi/hudi-common/src/main/java/org/apache/hudi/storage/HoodieStorageFactory.java#L36-L38)
 calls
   - Updated imports across multiple modules to use 
[HoodieStorageFactory](file:///Users/matthew/Desktop/Java%20Project/hudi/hudi-common/src/main/java/org/apache/hudi/storage/HoodieStorageFactory.java#L28-L76)
 instead of 
[HoodieHadoopStorage](file:///Users/matthew/Desktop/Java%20Project/hudi/hudi-hadoop-common/src/main/java/org/apache/hudi/storage/hadoop/HoodieHadoopStorage.java#L58-L305)
   - Added 
[HadoopFSUtils](file:///Users/matthew/Desktop/Java%20Project/hudi/hudi-hadoop-common/src/main/java/org/apache/hudi/hadoop/fs/HadoopFSUtils.java#L67-L567)
 imports where needed for storage configuration conversion
   - Modified test cases in the following modules:
     - hudi-cli (2 occurrences)
     - hudi-client-common (4 occurrences)
     - hudi-java-client (2 occurrences)
     - hudi-spark-client (2 occurrences)
     - hudi-hadoop-common tests (9 occurrences)
     - hudi-hadoop-mr (5 occurrences)
     - hudi-utilities (6 occurrences)
     - hudi-spark-datasource (1 occurrence)
     - hudi-hive-sync (1 occurrence)
   
   ### Impact
   
   **Public API Changes:** None - This is an internal refactoring only.
   
   **User-Facing Changes:** None - No behavioral changes for end users.
   
   **Performance Impact:** Negligible - The factory pattern adds minimal 
overhead (one additional method call).
   
   ### Risk Level
   
   **Low**
   
   **Mitigation:**
   - The refactoring preserves existing functionality - only the instantiation 
pattern changed
   - Internal implementation classes 
([HoodieHadoopIOFactory](file:///Users/matthew/Desktop/Java%20Project/hudi/hudi-hadoop-common/src/main/java/org/apache/hudi/io/storage/hadoop/HoodieHadoopIOFactory.java#L42-L134),
 
[HoodieHadoopStorage](file:///Users/matthew/Desktop/Java%20Project/hudi/hudi-hadoop-common/src/main/java/org/apache/hudi/storage/hadoop/HoodieHadoopStorage.java#L58-L305)
 itself) continue to use direct instantiation as needed
   - No changes to storage behavior, configurations, or file formats
   
   ### Documentation Update
   
   **none** - This is an internal code refactoring with no user-facing changes, 
configuration updates, or new features requiring documentation.
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable


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

Reply via email to