[Improvement]: Load process factories via DefaultTableRuntimeFactory#4100
Open
baiyangtx wants to merge 1 commit intoapache:masterfrom
Open
[Improvement]: Load process factories via DefaultTableRuntimeFactory#4100baiyangtx wants to merge 1 commit intoapache:masterfrom
baiyangtx wants to merge 1 commit intoapache:masterfrom
Conversation
## Summary Wire the new process plugin model into AMS so that table processes are discovered from `ProcessFactory` implementations and scheduled via the existing `ProcessService`. ## Details - Extend `DefaultTableRuntimeFactory` to implement the `TableRuntimeFactory` process APIs: - Aggregate installed `ProcessFactory` instances by `TableFormat` / `Action` and expose derived `ActionCoordinator` plugins via `supportedCoordinators()` - Merge `DefaultTableRuntime.REQUIRED_STATES` with additional states required by all process factories for the same format when building `TableRuntimeCreator` - Keep using `DefaultTableRuntime` without introducing extra runtime types - Introduce `DefaultActionCoordinator` to bridge `ProcessFactory` trigger/recover semantics to the existing scheduler: - Build trigger strategies from `ProcessFactory#triggerStrategy` - Delegate `trigger` and `recoverTableProcess` to the underlying factory - Add `TableProcessFactoryManager` as an `AbstractPluginManager<ProcessFactory>` using the `process-factories` plugin namespace - Refactor `AmoroServiceContainer` startup sequence: - Initialize `TableProcessFactoryManager` and collect all installed `ProcessFactory` instances - Initialize all `TableRuntimeFactory` plugins with the shared list of process factories - Collect all derived `ActionCoordinator`s from table runtime factories and inject them into `ProcessService` - Update `ProcessService` to accept a pre-built list of `ActionCoordinator`s while keeping the original constructors for backward compatibility and tests - Run `mvn spotless:apply` and `mvn -pl amoro-ams -am -DskipTests compile` to ensure style and compilation pass Co-Authored-By: Aime <aime@bytedance.com> Change-Id: Iaa867503c8b0bf93c2b7f0b8fe7d752e2ddbac67
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR is a subtask of #4100
Wire the new process plugin model(Introduced by #4097) into AMS so that table processes are discovered from
ProcessFactoryimplementations and scheduled via the existingProcessService.Details
DefaultTableRuntimeFactoryto implement theTableRuntimeFactoryprocess APIs:ProcessFactoryinstances byTableFormat/Actionand expose derivedActionCoordinatorplugins viasupportedCoordinators()DefaultTableRuntime.REQUIRED_STATESwith additional states required by all process factories for the same format when buildingTableRuntimeCreatorDefaultTableRuntimewithout introducing extra runtime typesDefaultActionCoordinatorto bridgeProcessFactorytrigger/recover semantics to the existing scheduler:ProcessFactory#triggerStrategytriggerandrecoverTableProcessto the underlying factoryTableProcessFactoryManageras anAbstractPluginManager<ProcessFactory>using theprocess-factoriesplugin namespaceAmoroServiceContainerstartup sequence:TableProcessFactoryManagerand collect all installedProcessFactoryinstancesTableRuntimeFactoryplugins with the shared list of process factoriesActionCoordinators from table runtime factories and inject them intoProcessServiceProcessServiceto accept a pre-built list ofActionCoordinators while keeping the original constructors for backward compatibility and testsmvn spotless:applyandmvn -pl amoro-ams -am -DskipTests compileto ensure style and compilation pass