morningman opened a new pull request, #61861: URL: https://github.com/apache/doris/pull/61861
## Summary This PR completes **Phase 0** of the [FE filesystem SPI refactoring](https://github.com/apache/doris/issues/61860) — removing compile-time couplings that would otherwise prevent splitting filesystem implementations into independent Maven modules in later phases. ## Changes ### P0.1 — FsStorageType enum migration - Introduce `FsStorageType` enum in `fe-foundation` (zero-dependency module) to replace Thrift-generated `StorageBackend.StorageType` in `PersistentFileSystem` - Add `FsStorageTypeAdapter` in `fe-core` for bidirectional Thrift↔FsStorageType conversion - Update all subclasses and callers: `Repository`, `BackupJob`, `RestoreJob`, `CloudRestoreJob` ### P0.2 — ObjStorage IOException bridge - Add `IOException`-based `default` bridge methods to `ObjStorage` interface: `checkObjectExists`, `getObjectChecked`, `putObjectChecked`, `deleteObjectChecked`, `deleteObjectsChecked`, `copyObjectChecked`, `listObjectsChecked` - Add `ObjStorageStatusAdapter` for `Status→IOException` conversion (maps `NOT_FOUND` → `FileNotFoundException`) - Zero changes to existing `S3ObjStorage`/`AzureObjStorage` implementations ### P0.3 — SwitchingFileSystem decoupling - Introduce `FileSystemLookup` functional interface - Refactor `SwitchingFileSystem` to accept `FileSystemLookup` instead of `ExternalMetaCacheMgr` - Update `FileSystemProviderImpl` to pass a lambda: `key -> extMetaCacheMgr.getFsCache().getRemoteFileSystem(key)` ### P0.4 — MultipartUploadCapable interface - Extract `MultipartUploadCapable` interface from `ObjFileSystem`, removing the forced `abstract completeMultipartUpload` method - `S3FileSystem` and `AzureFileSystem` now explicitly `implements MultipartUploadCapable` - `HMSTransaction` updated to use `instanceof MultipartUploadCapable` check instead of `ObjFileSystem` cast ### P0.5 — GsonUtils compile-time decoupling - Introduce `FileSystemDescriptor` POJO for `Repository` metadata serialization, replacing direct `PersistentFileSystem` subclass serialization - `Repository` gains `fs_descriptor` field (new format) with backward-compatible reading of old `storage` field - `GsonUtils` removes 7 compile-time imports of concrete filesystem classes; replaces with `Class.forName()` string-based reflection (graceful `ClassNotFoundException` handling) ### P0.6 — FileSystemSpiProvider skeleton - Add `FileSystemSpiProvider` interface in `fs/spi/` as the future ServiceLoader contract for Phase 3 module split ### Build fix - Fix Maven build cache incorrectly skipping `checkstyle:check` (`runAlways` + include checkstyle config files in cache input) - Fix 2 checkstyle violations introduced by this refactoring (unused import, import order) ## Testing - FE build passes: `./build.sh --fe` ✅ - Checkstyle: 0 violations ✅ - All changes are backward compatible; no behavior change ## Related Closes part of #61860 -- 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]
