Commit 7b9f890
[controller] Extract VersionLifecyclePolicy from VeniceHelixAdmin / VeniceParentHelixAdmin (linkedin#2827)
[controller] Extract VersionLifecyclePolicy from VeniceHelixAdmin / VeniceParentHelixAdmin
VeniceHelixAdmin is a ~10k-line god class. Carve a new com.linkedin.venice.controller.versionlifecycle sub-package and land its first helper, VersionLifecyclePolicy — a final pure-statics class (no I/O against controller state, all dependencies passed in) that owns the lifecycle decisions previously
buried in the admins. Mirrors HybridStoreConfigPolicy's shape and seeds the planned per-concern decomposition (TopicLifecycleManager, VersionRetirementManager, VersionProvisioner, CurrentVersionManager — named in package-info.java).
Lifted, with call-site rewires in VeniceHelixAdmin, VeniceParentHelixAdmin, and DataRecoveryManager: checkBackupVersionCleanupCapacityForNewPush, checkRollbackOriginVersionCapacityForNewPush, getBackupVersionNumber, getFinalReturnStatus, getOverallPushStatus, hasFatalDataValidationError,
updateStoreTTLRepushFlag, isRealTimeTopicRequired (with isParent() inlined as a boolean arg), checkPreConditionForSingleVersionDeletion (4-arg pure variant; the 3-arg admin wrapper that does the I/O lookup is retained for its two callers), and the STATUS_PRIORITIES constant (package-private to match its
original visibility and satisfy spotbugs MS_MUTABLE_COLLECTION_PKGPROTECT). Method bodies are byte-identical to the originals; admin call sites inline the (config, time, isParent) arguments the deleted instance wrappers used to resolve. The stale admin-side javadoc on isRealTimeTopicRequired — which
described parent-region conditions the body never actually checked — is replaced with one that matches the code.
Tests: consolidate the two standalone capacity tests (TestBackupVersionCleanupCapacityCheck, TestRollbackOriginVersionCapacityCheck) plus in-admin coverage for getFinalReturnStatus / getOverallPushStatus / updateStoreTTLRepushFlag / isRealTimeTopicRequired into a new versionlifecycle/ test package,
organized along source-class section boundaries so they travel with their owners on the planned per-helper extractions: NewPushCapacityGuardsTest (19), PushStatusAggregationTest (11), LifecyclePredicatesTest (17), VersionSelectionTest (4) = 51 tests. Shared mock factories and constants live in
package-private VersionLifecycleTestSupport. The two existing integration tests (TestPushBlocked{ByRollbackOriginGuard,WithinMinCleanupDelay}) only had their javadoc {@link}s retargeted.
Net: VeniceHelixAdmin -300, VeniceParentHelixAdmin -59, new policy +311, new test files +917, deleted in-admin/standalone tests -662. No protocol or wire-format change; getBackupVersionNumber was not on the Admin interface, so the lift is internal-only.
Co-authored-by: Ali Poursamadi <apoursamadi@linkedin.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 97d84bf commit 7b9f890
17 files changed
Lines changed: 1275 additions & 992 deletions
File tree
- clients/venice-push-job/src/main/java/com/linkedin/venice/hadoop
- internal/venice-test-common/src/integrationTest/java/com/linkedin/venice/endToEnd
- services/venice-controller/src
- main/java/com/linkedin/venice/controller
- datarecovery
- versionlifecycle
- test/java/com/linkedin/venice/controller
- versionlifecycle
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | | - | |
| 436 | + | |
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
Lines changed: 26 additions & 274 deletions
Large diffs are not rendered by default.
Lines changed: 5 additions & 54 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| |||
1885 | 1886 | | |
1886 | 1887 | | |
1887 | 1888 | | |
1888 | | - | |
| 1889 | + | |
1889 | 1890 | | |
1890 | 1891 | | |
1891 | 1892 | | |
| |||
2745 | 2746 | | |
2746 | 2747 | | |
2747 | 2748 | | |
2748 | | - | |
| 2749 | + | |
2749 | 2750 | | |
2750 | 2751 | | |
2751 | 2752 | | |
| |||
4505 | 4506 | | |
4506 | 4507 | | |
4507 | 4508 | | |
4508 | | - | |
4509 | | - | |
| 4509 | + | |
| 4510 | + | |
4510 | 4511 | | |
4511 | 4512 | | |
4512 | 4513 | | |
| |||
4710 | 4711 | | |
4711 | 4712 | | |
4712 | 4713 | | |
4713 | | - | |
4714 | | - | |
4715 | | - | |
4716 | | - | |
4717 | | - | |
4718 | | - | |
4719 | | - | |
4720 | | - | |
4721 | | - | |
4722 | | - | |
4723 | | - | |
4724 | | - | |
4725 | | - | |
4726 | | - | |
4727 | | - | |
4728 | | - | |
4729 | | - | |
4730 | | - | |
4731 | | - | |
4732 | | - | |
4733 | | - | |
4734 | | - | |
4735 | | - | |
4736 | | - | |
4737 | | - | |
4738 | | - | |
4739 | | - | |
4740 | | - | |
4741 | | - | |
4742 | | - | |
4743 | | - | |
4744 | | - | |
4745 | | - | |
4746 | | - | |
4747 | | - | |
4748 | | - | |
4749 | | - | |
4750 | | - | |
4751 | | - | |
4752 | | - | |
4753 | | - | |
4754 | | - | |
4755 | | - | |
4756 | | - | |
4757 | | - | |
4758 | | - | |
4759 | | - | |
4760 | | - | |
4761 | | - | |
4762 | | - | |
4763 | 4714 | | |
4764 | 4715 | | |
4765 | 4716 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
138 | | - | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| |||
0 commit comments