Skip to content

[SPARK-58773] Add scg-routing crate - #3

Closed
viirya wants to merge 1 commit into
apache:mainfrom
viirya:import-02-routing
Closed

[SPARK-58773] Add scg-routing crate#3
viirya wants to merge 1 commit into
apache:mainfrom
viirya:import-02-routing

Conversation

@viirya

@viirya viirya commented Aug 14, 2026

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

Part of importing the Spark Connect Gateway reference implementation into
apache/spark-connect-gateway as a series of small, bottom-up PRs (tracked in
the do-not-merge reference PR #1).

This adds the scg-routing crate — the routing core of the gateway. It defines
the central traits and types that the pool and store layers implement and that
the proxy routes through:

  • SessionKey — the routing key derived from a request
  • Pool — the backend-pool trait (implemented later by pool-static / pool-k8s)
  • AffinityStore — the session-affinity store trait (implemented later by
    store-memory / store-redis)
  • Router — ties them together

scg-routing is a leaf crate (no internal dependencies), so it compiles and
tests on its own. It is appended to the workspace members list. Subsequent
PRs add the crates that depend on it.

Why are the changes needed?

Implements the reference gateway from the approved SPIP (SPARK-58455), imported
one reviewable piece at a time.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings,
cargo build --workspace, and cargo test --workspace all pass locally
(scg-routing has 15 unit tests).

Was this patch authored or co-authored using generative AI tooling?

Yes, co-authored with Claude Code.

Part of importing the Spark Connect Gateway reference implementation into
apache/spark-connect-gateway as a series of small, bottom-up PRs.

This adds the scg-routing crate — the routing core of the gateway. It defines
the central traits and types that the pool and store layers implement and that
the proxy routes through: SessionKey, the Pool trait (implemented later by
pool-static / pool-k8s), the AffinityStore trait (implemented later by
store-memory / store-redis), and the Router that ties them together.

scg-routing is a leaf crate (no internal dependencies), so it compiles and
tests on its own. It is appended to the workspace members list. Subsequent PRs
add the crates that depend on it.

Co-authored-by: Claude Code
@viirya

viirya commented Aug 19, 2026

Copy link
Copy Markdown
Member Author

Thank you @HyukjinKwon @dongjoon-hyun !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants