feat: PrivateLink support (phase 1)#803
Open
nikagra wants to merge 2 commits intoscylladb:scylla-4.xfrom
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements Phase 1 of PrivateLink support for the ScyllaDB Java Driver, introducing a configuration API for Client Routes to support AWS PrivateLink-style deployments. The implementation provides programmatic configuration for connection endpoints without the full handler implementation (deferred to future phases).
Changes:
- Introduced new API classes
ClientRoutesConfigandClientRoutesEndpointfor programmatic endpoint configuration - Extended
SessionBuilderwithwithClientRoutesConfig()method, including validation for mutual exclusivity with custom AddressTranslator and automatic seed host derivation - Added configuration option
advanced.client-routes.table-namewith supporting infrastructure inDefaultDriverOption,TypedDriverOption, andOptionsMap - Implemented URI-based address parsing supporting IPv4, IPv6 (bracketed), and hostname formats with port validation
- Extended
ProgrammaticArgumentsto pass client routes configuration through session initialization - Added comprehensive unit tests covering configuration builder, validation, and address parsing scenarios
- Updated documentation in
manual/core/address_resolution/README.mdexplaining client routes usage and constraints
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| pom.xml | Updates native-protocol dependency to SNAPSHOT version for CLIENT_ROUTES support |
| core/src/main/java/com/datastax/oss/driver/api/core/config/ClientRoutesEndpoint.java | New immutable API class representing a single endpoint with connection ID and optional DNS address |
| core/src/main/java/com/datastax/oss/driver/api/core/config/ClientRoutesConfig.java | New immutable configuration container with builder pattern for managing client routes endpoints |
| core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java | Adds CLIENT_ROUTES_TABLE_NAME option for system table configuration |
| core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java | Adds typed wrapper for CLIENT_ROUTES_TABLE_NAME option |
| core/src/main/java/com/datastax/oss/driver/api/core/config/OptionsMap.java | Sets default value "system.client_routes" for client routes table name |
| core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java | Integrates client routes configuration with validation, mutual exclusivity checks, and automatic seed host derivation using URI-based address parsing |
| core/src/main/java/com/datastax/oss/driver/api/core/session/ProgrammaticArguments.java | Extends to pass ClientRoutesConfig through session initialization |
| core/src/main/resources/reference.conf | Documents client-routes configuration section with table-name option |
| core/src/test/java/com/datastax/oss/driver/api/core/config/ClientRoutesConfigTest.java | Unit tests for ClientRoutesConfig builder functionality |
| core/src/test/java/com/datastax/oss/driver/api/core/session/ClientRoutesSessionBuilderTest.java | Tests for SessionBuilder integration with client routes |
| core/src/test/java/com/datastax/oss/driver/internal/core/session/ClientRoutesValidationTest.java | Comprehensive validation tests for address parsing edge cases |
| manual/core/address_resolution/README.md | Documentation for client routes feature with usage examples and constraints |
core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java
Show resolved
Hide resolved
.../src/test/java/com/datastax/oss/driver/internal/core/session/ClientRoutesValidationTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/com/datastax/oss/driver/api/core/session/ClientRoutesSessionBuilderTest.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java
Outdated
Show resolved
Hide resolved
17991f3 to
a5140da
Compare
core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/datastax/oss/driver/internal/core/util/AddressParser.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/datastax/oss/driver/api/core/config/ClientRoutesConfig.java
Outdated
Show resolved
Hide resolved
b0e0405 to
71a4208
Compare
… deployments feat: update client routes configuration details for mutual exclusivity with AddressTranslator and cloud bundles Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
71a4208 to
122da13
Compare
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.
Client Routes Configuration API (Phase 1)
Note: Depends on #java-native-protocol/45
Overview
Implements the configuration API for Client Routes feature to support PrivateLink-style cloud deployments (ScyllaDB Cloud). This is Phase 1 of the implementation - provides programmatic configuration without the full handler implementation.
Jira: DRIVER-88
Changes
New API Classes
ClientRoutesEndpoint- Represents a single endpoint with connection ID and optional DNS addressClientRoutesConfig- Immutable configuration container with builder patternSessionBuilder Integration
withClientRoutesConfig(ClientRoutesConfig)methodAddressTranslatorConfiguration
advanced.client-routes.table-nameoption (default:system.client_routes)ProgrammaticArgumentsto pass configuration through session initializationreference.confwith inline documentationAddress Parsing
Supported Address Formats
Usage Example
Testing
ClientRoutesConfigTest(8 tests)ClientRoutesSessionBuilderTest(2 tests, refactored to use Mockito)ClientRoutesValidationTestTypedDriverOptionTestandMapBasedDriverConfigLoaderTestDocumentation
manual/core/address_resolution/README.mdwith Client Routes sectionreference.confwith configuration optionschangelog/README.mdfor version 4.19.0Validation
✅ All unit tests passing (18 tests total)
✅ No compilation errors
✅ Mutual exclusivity validation working
✅ Seed host derivation working
✅ IPv6 support working
✅ Error messages clear and helpful
What's NOT Included (Future Work)
This PR provides the configuration API only. The following are intentionally deferred to future PRs:
CLIENT_ROUTES_CHANGEevent handling (stub exists inControlConnection)Design Decisions
Breaking Changes
None - this is a purely additive change.
Migration Guide
N/A - New feature, no migration needed.
Review Checklist
Related