[Cherry-pick to branch-1.2] [#10311] fix(optimizer): resolve built-in rewrite adapter by template name (#10307)#10312
Merged
diqiu50 merged 1 commit intobranch-1.2from Mar 9, 2026
Conversation
… name (#10307) ### What changes were proposed in this pull request? This PR fixes built-in adapter resolution for optimizer strategy job submission: - Map built-in template name `builtin-iceberg-rewrite-data-files` to `GravitinoCompactionJobAdapter` in `GravitinoJobSubmitter`. - Remove the legacy strategy-type alias mapping from the built-in adapter registry. - Update unit tests to align with the template-name-based contract. ### Why are the changes needed? `submit-strategy-jobs` submits jobs using the job template name from strategy/policy content. Before this change, built-in adapter lookup relied on a strategy-type alias path, which can cause submission failures like: `No job adapter found for template: builtin-iceberg-rewrite-data-files` This patch makes the lookup consistent with actual runtime input (`jobTemplateName`). Fix: #10311 ### Does this PR introduce _any_ user-facing change? Yes, a user-visible bug fix in optimizer behavior: - `gravitino-optimizer.sh --type submit-strategy-jobs` can now resolve the built-in rewrite template adapter through the default template-name mapping. - No user-facing API changes. - No property key additions/removals. ### How was this patch tested? - Added/updated unit tests in `TestGravitinoJobSubmitter`. - Ran: ```bash ./gradlew :maintenance:optimizer:test --tests org.apache.gravitino.maintenance.optimizer.recommender.job.TestGravitinoJobSubmitter -PskipITs ``` - Result: BUILD SUCCESSFUL.
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.
Cherry-pick Information:
branch-1.2