[refactor](fe) Extract isDynamicScheduleTable method to reduce code duplication#62477
Open
zclllyybb wants to merge 1 commit intoapache:masterfrom
Open
[refactor](fe) Extract isDynamicScheduleTable method to reduce code duplication#62477zclllyybb wants to merge 1 commit intoapache:masterfrom
zclllyybb wants to merge 1 commit intoapache:masterfrom
Conversation
…uplication Extract the dynamic partition table check logic into a private helper method `isDynamicScheduleTable()` and add documentation explaining that DynamicPartitionScheduler tracks both dynamic partition tables with scheduling enabled and auto partition tables using `partition.retention_count` for periodic cleanup.
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
Author
|
/review |
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
Contributor
There was a problem hiding this comment.
No blocking findings.
Critical checkpoint conclusions:
- Goal and correctness: The PR goal is to extract the duplicated dynamic-schedule table predicate into
isDynamicScheduleTable()and document whydynamicPartitionTableInfocontains both dynamic-partition tables and retention-count tables. The updated code still accomplishes that goal:initDynamicPartitionTable()now calls the helper, and the helper preserves the prior condition. - Scope and focus: The modification is small, clear, and limited to a single FE refactor in
DynamicPartitionScheduler. - Concurrency: Applicable but unchanged. The scheduler still evaluates the predicate under
table.readLock()ininitDynamicPartitionTable(), and the refactor does not introduce new shared-state access or alter locking behavior. - Lifecycle/static initialization: No special lifecycle or static initialization changes.
- Configuration: No new config items and no dynamic-config behavior changes.
- Compatibility: No protocol, storage format, symbol, or rolling-upgrade compatibility impact.
- Parallel code paths: I checked the other registration path in
DynamicPartitionUtil.registerOrRemoveDynamicPartitionTable(). The helper remains consistent with the scheduler's intended tracked-table set. - Special conditional logic: The extracted condition is the same as before; the new Javadoc makes the non-obvious retention-count case easier to understand.
- Test coverage: No dedicated test was added. For this patch that is acceptable because the behavior is unchanged and the change is a localized extraction/documentation refactor.
- Test results: No test outputs changed.
- Observability: No observability changes were needed; existing logs/runtime info remain untouched.
- Transaction/persistence: Not involved.
- Data writes/modifications: Not involved.
- FE-BE variable passing: Not involved.
- Performance: Neutral to slightly positive for readability/maintainability; no runtime regression identified.
- Other issues: None found in the reviewed scope.
Residual risk:
- Low. Because this is a behavior-preserving refactor, the main remaining risk would be an unnoticed semantic mismatch between initialization-time registration and later register/remove paths, but the current helper still matches the effective scheduler semantics I traced in surrounding code.
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.
Related PR: #61954
Problem Summary:
Extract the dynamic partition table check logic into a private helper method
isDynamicScheduleTable()and add documentation explaining that DynamicPartitionScheduler tracks both dynamic partition tables with scheduling enabled and auto partition tables usingpartition.retention_countfor periodic cleanup.