feat(optimizer): add data model — schema, entities, DTOs, converters#527
Draft
mkuchenbecker wants to merge 2 commits intolinkedin:mainfrom
Draft
feat(optimizer): add data model — schema, entities, DTOs, converters#527mkuchenbecker wants to merge 2 commits intolinkedin:mainfrom
mkuchenbecker wants to merge 2 commits intolinkedin:mainfrom
Conversation
Introduces the optimizer service module with: - MySQL/H2 schema for table_operations, table_stats, table_stats_history, and table_operations_history - JPA entities with JSON column support (vladmihalcea hibernate-types) - All model/DTO/enum types: OperationType, OperationStatus, TableStats, CompleteOperationRequest, JobResult, OperationMetrics, etc. - JPA AttributeConverters for JobResult and OperationMetrics JSON columns - MapStruct mapper (OptimizerMapper) for entity→DTO conversion - Spring Boot application shell and build wiring (settings.gradle, build.gradle dockerPrereqs) No repositories, controllers, or service layer yet — those follow in subsequent PRs. Co-Authored-By: Claude Opus 4.6 <[email protected]>
mkuchenbecker
commented
Apr 3, 2026
...ces/optimizer/src/main/java/com/linkedin/openhouse/optimizer/api/model/OperationMetrics.java
Outdated
Show resolved
Hide resolved
mkuchenbecker
commented
Apr 3, 2026
services/optimizer/src/main/java/com/linkedin/openhouse/optimizer/api/model/OperationType.java
Outdated
Show resolved
Hide resolved
mkuchenbecker
commented
Apr 3, 2026
...s/optimizer/src/main/java/com/linkedin/openhouse/optimizer/api/model/TableOperationsDto.java
Show resolved
Hide resolved
mkuchenbecker
commented
Apr 3, 2026
...izer/src/main/java/com/linkedin/openhouse/optimizer/api/model/TableOperationsHistoryDto.java
Outdated
Show resolved
Hide resolved
mkuchenbecker
commented
Apr 3, 2026
services/optimizer/src/main/java/com/linkedin/openhouse/optimizer/api/model/TableStats.java
Show resolved
Hide resolved
mkuchenbecker
commented
Apr 3, 2026
services/optimizer/src/main/java/com/linkedin/openhouse/optimizer/api/model/TableStatsDto.java
Show resolved
Hide resolved
mkuchenbecker
commented
Apr 3, 2026
...optimizer/src/main/java/com/linkedin/openhouse/optimizer/api/model/TableStatsHistoryDto.java
Show resolved
Hide resolved
mkuchenbecker
commented
Apr 3, 2026
...r/src/main/java/com/linkedin/openhouse/optimizer/api/model/UpsertTableOperationsRequest.java
Outdated
Show resolved
Hide resolved
mkuchenbecker
commented
Apr 3, 2026
...imizer/src/main/java/com/linkedin/openhouse/optimizer/api/model/UpsertTableStatsRequest.java
Show resolved
Hide resolved
mkuchenbecker
commented
Apr 3, 2026
...timizer/src/main/java/com/linkedin/openhouse/optimizer/entity/TableOperationsHistoryRow.java
Outdated
Show resolved
Hide resolved
- Remove OperationMetrics class and converter; stats are read directly from table_stats instead of duplicating into operations - Remove orphanFilesDeleted/orphanBytesDeleted from history entity, DTO, and schema; operation-specific data belongs in the result JSON - Add addedSizeBytes to CommitDelta for tracking write volume - Fix OperationType javadoc to describe current state, not roadmap - Fix TableOperationsHistoryRow javadoc: written on operation complete, not by Spark app directly - Add field comments to all DTOs and request objects Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.
Summary
PR 0 of 7 in the optimizer stack. Design doc.
Introduces the optimizer service module with the foundational data model layer. No repositories, controllers, or service layer yet -- those follow in subsequent PRs.
Changes
Schema (
optimizer-schema.sql): DDL fortable_operations,table_stats,table_stats_history, andtable_operations_history. Compatible with MySQL (prod) and H2 in MySQL mode (tests).JPA entities:
TableOperationsRow,TableOperationsHistoryRow,TableStatsRow,TableStatsHistoryRowwith JSON column support via vladmihalcea hibernate-types.Models/DTOs/enums:
OperationType,OperationStatus,OperationHistoryStatus,TableStats(nested snapshot + delta withaddedSizeBytes),JobResult, all request/response DTOs.Converter: JPA
AttributeConverterforJobResultJSON column.Mapper: MapStruct
OptimizerMapperfor entity to DTO conversion.Build wiring:
settings.gradleinclude,build.gradledockerPrereqs dependency.Testing Done
This PR contains only the data model (entities, DTOs, converters) with no repositories or service logic to test. Repository tests follow in PR 1. Verified:
./gradlew :services:optimizer:compileJavapasses./gradlew compileJava(full project) passes with no regressionsAdditional Information
Optimizer Stack
optimizer-0optimizer-1optimizer-2optimizer-3optimizer-4optimizer-5optimizer-6optimizer-7