feat(sdk): route LoadJob APIs to Transfer when enabled - #1467
Merged
Conversation
Keep LoadJob/Java surfaces compatible by switching on transfer.enabled.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a config-driven compatibility layer so the Rust SDK JobClient (and the blocking helpers that Java CurvineLoadClient relies on) can route LoadJob operations to the Transfer service when transfer.enabled=true, while keeping the existing LoadJob-facing API types (LoadJobResult, JobStatus, JobTaskState) stable for callers.
Changes:
- Introduces
transfer_compatadapter to submit/status/cancel/wait via Transfer when enabled, mapping Transfer states/responses back into LoadJob models. - Re-routes Rust async + blocking LoadJob helpers through the adapter.
- Adds JavaDoc describing the backend routing behavior; wires in needed Rust deps (
curvine-proto,tokio,log).
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| curvine-libsdk/java/src/main/java/io/curvine/CurvineLoadClient.java | Documents routing based on transfer.enabled and response mapping behavior. |
| crates/sdk/curvine-sdk-core/src/job.rs | Routes async JobClient calls through core::transfer_compat. |
| crates/sdk/curvine-sdk-core/src/core/transfer_compat.rs | New dual-path adapter: legacy JobMaster vs Transfer client, including state/response mapping and wait loop. |
| crates/sdk/curvine-sdk-core/src/core/mod.rs | Exposes transfer_compat module internally. |
| crates/sdk/curvine-sdk-core/src/core/job.rs | Routes blocking helper functions through transfer_compat. |
| crates/sdk/curvine-sdk-core/Cargo.toml | Adds dependencies required by transfer_compat (proto types, tokio time, logging). |
| Cargo.lock | Updates lockfile to include new SDK-core deps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+97
to
+110
| let input = Path::from_str(&command.source_path)?; | ||
| let (source, target) = if let Some(target_path) = &command.target_path { | ||
| (input, Path::from_str(target_path)?) | ||
| } else { | ||
| let peer = match fs.toggle_path(&input, true).await? { | ||
| Some(peer) => peer, | ||
| None => return err_box!("{} is not mounted", command.source_path), | ||
| }; | ||
| if input.is_cv() { | ||
| (peer, input) | ||
| } else { | ||
| (input, peer) | ||
| } | ||
| }; |
jlon
approved these changes
Aug 3, 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.
Summary
Route Rust
JobClient/ blocking LoadJob helpers (and thus JavaCurvineLoadClient) to the Transfer service whentransfer.enabled=true, while preserving the existing LoadJob API surface for legacy clusters.Issue Describe / Design
No linked issue.
transfer.enabled)LoadJobResult/JobStatus/JobTaskStateChanges
crates/sdk/curvine-sdk-core/src/core/transfer_compat.rstransfer.enabled=falsecrates/sdk/curvine-sdk-core/src/{job,core/job}.rscurvine-libsdk/java/.../CurvineLoadClient.javaTest verified
make formatcargo test -p curvine-sdk-core --lib transfer_compatcargo check -p curvine-libsdk-javaDependencies