Skip to content

Commit dcffc75

Browse files
committed
Add grpc impl of scheduler's storage client
1 parent c36c6e1 commit dcffc75

5 files changed

Lines changed: 420 additions & 0 deletions

File tree

components/spider-scheduler/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ path = "src/lib.rs"
1010
[dependencies]
1111
async-trait = "0.1.89"
1212
spider-core = { path = "../spider-core" }
13+
spider-proto-rust = { path = "../spider-proto-rust" }
1314
thiserror = "2.0.18"
15+
tonic = "0.12.3"
1416
tokio-util = "0.7.18"

components/spider-scheduler/src/error.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,25 @@ pub enum StorageClientError {
1212
/// No job with the requested identifier exists.
1313
#[error("job not found: {0:?}")]
1414
JobNotFound(JobId),
15+
16+
/// The scheduler's storage session is stale.
17+
#[error("stale storage session: {storage_session:?}")]
18+
StaleSession {
19+
/// Storage's current session ID.
20+
storage_session: SessionId,
21+
},
22+
23+
/// The storage server returned an invalid input error.
24+
#[error("invalid storage request: {0}")]
25+
InvalidInput(String),
26+
27+
/// The storage server returned an otherwise-uncategorized error.
28+
#[error("storage server error: {0}")]
29+
Server(String),
30+
31+
/// The storage transport failed or returned malformed data.
32+
#[error("storage transport error: {0}")]
33+
Transport(String),
1534
}
1635

1736
/// Errors returned by the scheduler runtime and its components.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//! gRPC-backed scheduler client implementations.
2+
3+
mod storage_client;
4+
5+
pub use storage_client::GrpcSchedulerStorageClient;

0 commit comments

Comments
 (0)