Skip to content

Commit

Permalink
[#1407] fix(rust): return error when getting data from hdfs by client (
Browse files Browse the repository at this point in the history
…#1507)

### What changes were proposed in this pull request?

If client using the `memory_local` type, but the server is using `memory_hdfs` type, 
server will panic when getting shuffle data. This PR is to avoid this.

### Why are the changes needed?

This is the sub-tasks for #1407 .

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

needn't
  • Loading branch information
zuston authored Feb 5, 2024
1 parent 576a925 commit aca0203
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions rust/experimental/server/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ pub enum WorkerError {

#[error("Hdfs native client not found for app: {0}")]
HDFS_NATIVE_CLIENT_NOT_FOUND(String),

#[error("Data should be read from hdfs in client side instead of from server side")]
NOT_READ_HDFS_DATA_FROM_SERVER,
}

impl From<AcquireError> for WorkerError {
Expand Down
4 changes: 2 additions & 2 deletions rust/experimental/server/src/store/hdfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,14 @@ impl Store for HdfsStore {
}

async fn get(&self, _ctx: ReadingViewContext) -> Result<ResponseData, WorkerError> {
todo!()
Err(WorkerError::NOT_READ_HDFS_DATA_FROM_SERVER)
}

async fn get_index(
&self,
_ctx: ReadingIndexViewContext,
) -> Result<ResponseDataIndex, WorkerError> {
todo!()
Err(WorkerError::NOT_READ_HDFS_DATA_FROM_SERVER)
}

async fn require_buffer(
Expand Down

0 comments on commit aca0203

Please sign in to comment.