Align DistSQL handler package layout in kernel/distsql#6
Align DistSQL handler package layout in kernel/distsql#6
Conversation
Co-authored-by: linghengqian <20187731+linghengqian@users.noreply.github.com>
Co-authored-by: linghengqian <20187731+linghengqian@users.noreply.github.com>
Co-authored-by: linghengqian <20187731+linghengqian@users.noreply.github.com>
Fixed the migrated unit tests, updated reachability metadata, and ran Spotless, scoped tests, and Checkstyle. Latest commit: 4e113c4. |
Co-authored-by: linghengqian <20187731+linghengqian@users.noreply.github.com>
Restored SetDistVariableExecutorTest, RefreshDatabaseMetaDataExecutorTest, and DistSQLUpdateProxyBackendHandlerTest in commit b48d4f8. |
Co-authored-by: linghengqian <20187731+linghengqian@users.noreply.github.com>
Completed the package realignment to handler/ral/queryable, handler/ral/updatable, and handler/rul (sources, tests, SPI, reachability metadata). Commit: 1ea8e20. |
There was a problem hiding this comment.
Pull request overview
This PR migrates DistSQL handler executors from the proxy/backend/handler/distsql package to a new kernel/distsql/handler module, aligning with the final package structure for the ShardingSphere kernel architecture.
Changes:
- Created new Maven module structure (
kernel/distsqlandkernel/distsql/handler) - Migrated RAL queryable/updatable and RUL handlers to new package namespace
- Updated SPI registrations and native-image reachability metadata
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| kernel/pom.xml | Added distsql submodule to kernel parent |
| kernel/distsql/pom.xml | New parent POM for distsql module |
| kernel/distsql/handler/pom.xml | New handler module with appropriate dependencies |
| kernel/distsql/handler/src/main/java/**/*.java | Migrated executor implementations with package updates |
| kernel/distsql/handler/src/test/java/**/*.java | Migrated and simplified test files |
| kernel/distsql/handler/.../DistSQLUpdateExecutor | New SPI registrations for migrated updatable executors |
| kernel/distsql/handler/.../DistSQLQueryExecutor | New SPI registrations for migrated queryable executors |
| proxy/backend/core/pom.xml | Added dependency on new distsql-handler module |
| proxy/backend/core/.../DistSQLUpdateExecutor | Removed SPI registrations for migrated executors |
| proxy/backend/core/.../DistSQLQueryExecutor | Removed SPI registrations for migrated executors |
| proxy/backend/core/src/test/java/**/*.java | Deleted migrated test files |
| infra/reachability-metadata/.../reachability-metadata.json | Updated class references for native-image compilation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private HintValueContext copyHintValueContext(final HintValueContext hintValueContext) { | ||
| HintValueContext result = new HintValueContext(); | ||
| result.getShardingDatabaseValues().putAll(hintValueContext.getShardingDatabaseValues()); | ||
| result.getShardingTableValues().putAll(hintValueContext.getShardingTableValues()); | ||
| result.getDisableAuditNames().addAll(hintValueContext.getDisableAuditNames()); | ||
| result.setDataSourceName(hintValueContext.getDataSourceName()); | ||
| result.setDatabaseShardingOnly(hintValueContext.isDatabaseShardingOnly()); | ||
| result.setWriteRouteOnly(hintValueContext.isWriteRouteOnly()); | ||
| result.setSkipSQLRewrite(hintValueContext.isSkipSQLRewrite()); | ||
| result.setShadow(hintValueContext.isShadow()); | ||
| return result; | ||
| } | ||
|
|
There was a problem hiding this comment.
Please explain why it is necessary to manually copy a new class.
There was a problem hiding this comment.
The new helper copies the HintValueContext so we can set skipMetadataValidate without mutating the shared context from the connection (avoids side effects on the original QueryContext). This keeps preview execution isolated. Commit: 1ea8e20.
Relocates the migrated DistSQL executors into the finalized package layout for the new kernel/distsql module, matching the original proxy
ralandrulnamespaces.Changes Made
org.apache.shardingsphere.distsql.handler.ral.*and RUL handlers underorg.apache.shardingsphere.distsql.handler.rul.*.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.