Skip to content

[Improvement]: Load process factories via DefaultTableRuntimeFactory#4100

Open
baiyangtx wants to merge 1 commit intoapache:masterfrom
baiyangtx:upstream/table-runtime-factory
Open

[Improvement]: Load process factories via DefaultTableRuntimeFactory#4100
baiyangtx wants to merge 1 commit intoapache:masterfrom
baiyangtx:upstream/table-runtime-factory

Conversation

@baiyangtx
Copy link
Contributor

@baiyangtx baiyangtx commented Feb 26, 2026

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 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 ActionCoordinators from table runtime factories and inject them into ProcessService
  • Update ProcessService to accept a pre-built list of ActionCoordinators 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

## 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
@github-actions github-actions bot added the module:ams-server Ams server module label Feb 26, 2026
@baiyangtx baiyangtx marked this pull request as ready for review February 26, 2026 13:32
@baiyangtx baiyangtx changed the title [Feature]: Load process factories via DefaultTableRuntimeFactory [Improvement]: Load process factories via DefaultTableRuntimeFactory Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:ams-server Ams server module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant