feat(optimizer): [2/N] Optimizer REST service layer#531
Open
mkuchenbecker wants to merge 6 commits intomkuchenb/optimizer-1from
Open
feat(optimizer): [2/N] Optimizer REST service layer#531mkuchenbecker wants to merge 6 commits intomkuchenb/optimizer-1from
mkuchenbecker wants to merge 6 commits intomkuchenb/optimizer-1from
Conversation
This was referenced Apr 6, 2026
mkuchenbecker
commented
Apr 6, 2026
...c/main/java/com/linkedin/openhouse/optimizer/repository/TableOperationHistoryRepository.java
Outdated
Show resolved
Hide resolved
mkuchenbecker
commented
Apr 6, 2026
...zer/src/main/java/com/linkedin/openhouse/optimizer/repository/TableOperationsRepository.java
Show resolved
Hide resolved
mkuchenbecker
commented
Apr 6, 2026
...zer/src/main/java/com/linkedin/openhouse/optimizer/repository/TableOperationsRepository.java
Outdated
Show resolved
Hide resolved
mkuchenbecker
commented
Apr 6, 2026
...zer/src/main/java/com/linkedin/openhouse/optimizer/repository/TableOperationsRepository.java
Outdated
Show resolved
Hide resolved
mkuchenbecker
commented
Apr 6, 2026
...zer/src/main/java/com/linkedin/openhouse/optimizer/repository/TableOperationsRepository.java
Outdated
Show resolved
Hide resolved
mkuchenbecker
commented
Apr 6, 2026
...ptimizer/src/main/java/com/linkedin/openhouse/optimizer/repository/TableStatsRepository.java
Outdated
Show resolved
Hide resolved
Service interface and implementation for all optimizer CRUD operations including complete-operation lifecycle, stats upsert with history double-write, and filtered queries. Three REST controllers expose the endpoints. The apps/optimizer shared module provides lightweight entity/repo copies for the analyzer and scheduler apps. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Align OptimizerDataServiceImpl with renamed repository methods from optimizer-1 review feedback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
e628426 to
ef3260f
Compare
Resolve repo conflicts by taking optimizer-1's clean find-only versions. Scheduler-specific methods and streamAll removed per review feedback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mkuchenbecker
commented
Apr 6, 2026
...mizer/src/main/java/com/linkedin/openhouse/optimizer/api/model/CompleteOperationRequest.java
Outdated
Show resolved
Hide resolved
mkuchenbecker
commented
Apr 6, 2026
Collaborator
Author
mkuchenbecker
left a comment
There was a problem hiding this comment.
this needs tests
Propagate CompleteOperationRequest orphan field removal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
H2 integration tests for OptimizerDataServiceImpl covering completeOperation (write history, not-found) and upsertTableStats (create, update, history append). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mkuchenbecker
commented
Apr 6, 2026
| TableStatsDto dto = service.upsertTableStats(tableUuid, second); | ||
|
|
||
| assertThat(dto.getStats().getSnapshot().getTableSizeBytes()).isEqualTo(200L); | ||
| assertThat(statsRepository.findAll()).hasSize(1); |
Collaborator
Author
There was a problem hiding this comment.
what about stats history? every call should update the history and do an upsert. The history is the raw delta.
Strengthen upsertTableStats test to verify history rows contain the raw delta stats from each call, not just the row count. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Apr 7, 2026
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.
Optimizer Stack
Summary
PR 2 of N in the optimizer stack.
Overall Project
Service Design doc.
Service layer and REST controllers for the optimizer service, plus the
apps/optimizershared module providing lightweight entity/repo copies for the analyzer and scheduler apps.Changes
Service layer:
OptimizerDataServiceinterface andOptimizerDataServiceImpl— CRUD operations, complete-operation lifecycle, stats upsert with history double-write, filtered queries.Controllers:
TableOperationsController,TableOperationsHistoryController,TableStatsController— REST endpoints per the design doc API spec.Shared module (
apps/optimizer): Lightweight entity and repository copies used by the analyzer and scheduler apps to read optimizer state directly from MySQL.Testing Done
H2 integration tests in
OptimizerDataServiceImplTest(5 tests):completeOperation_writesHistoryFromOperationRow— saves SCHEDULED row, completes it, asserts history DTO fieldscompleteOperation_notFound_returnsEmpty— completes nonexistent ID, asserts emptyupsertTableStats_createsNewRow— upserts new table, asserts DTO and repo rowupsertTableStats_updatesExistingRow— upserts twice, asserts overwrite with single rowupsertTableStats_appendsHistoryOnEveryCall— upserts twice, asserts 2 history rowsAdditional Information