This is an automated email from the ASF dual-hosted git repository.
zuston pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git
The following commit(s) were added to refs/heads/master by this push:
new aca0203c6 [#1407] fix(rust): return error when getting data from hdfs
by client (#1507)
aca0203c6 is described below
commit aca0203c6fb514eddd86a306ea1c1a6a8ad975fb
Author: Junfan Zhang <[email protected]>
AuthorDate: Mon Feb 5 16:10:22 2024 +0800
[#1407] fix(rust): return error when getting data from hdfs by client
(#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
---
rust/experimental/server/src/error.rs | 3 +++
rust/experimental/server/src/store/hdfs.rs | 4 ++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/rust/experimental/server/src/error.rs
b/rust/experimental/server/src/error.rs
index c39adfcf4..bb0c1a18e 100644
--- a/rust/experimental/server/src/error.rs
+++ b/rust/experimental/server/src/error.rs
@@ -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 {
diff --git a/rust/experimental/server/src/store/hdfs.rs
b/rust/experimental/server/src/store/hdfs.rs
index 8abf563ab..a3e602a63 100644
--- a/rust/experimental/server/src/store/hdfs.rs
+++ b/rust/experimental/server/src/store/hdfs.rs
@@ -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(