You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "jorgehermo9 (via GitHub)" <gi...@apache.org> on 2025/04/27 16:03:59 UTC
[PR] refactor(services/webhdfs): Refactor raw request send in writer and b… [opendal]
jorgehermo9 opened a new pull request, #6113:
URL: https://github.com/apache/opendal/pull/6113
Now all `self.info.http_client().send(req).await` happen in `core.rs`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor(services/webhdfs): Refactor raw request send in writer and b… [opendal]
Posted by "jorgehermo9 (via GitHub)" <gi...@apache.org>.
jorgehermo9 commented on code in PR #6113:
URL: https://github.com/apache/opendal/pull/6113#discussion_r2062667298
##########
core/src/services/webhdfs/core.rs:
##########
@@ -235,44 +240,46 @@ impl WebhdfsCore {
let req = Request::post(url);
- req.body(Buffer::new()).map_err(new_request_build_error)
+ let req = req.body(Buffer::new()).map_err(new_request_build_error)?;
+
+ self.info.http_client().send(req).await
}
- fn webhdfs_open_request(&self, path: &str, range: &BytesRange) -> Result<Request<Buffer>> {
+ pub async fn webhdfs_list_status(&self, path: &str) -> Result<Response<Buffer>> {
Review Comment:
As I moved the `webhdfs_open_request` to be next `webhdfs_read_file`, the diff seems to be broken and it appears that I changed a lot... But I just moved the `webhdfs_open_request` a few lines down :/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor(services/webhdfs): Refactor raw request send in writer and backend [opendal]
Posted by "jorgehermo9 (via GitHub)" <gi...@apache.org>.
jorgehermo9 closed pull request #6113: refactor(services/webhdfs): Refactor raw request send in writer and backend
URL: https://github.com/apache/opendal/pull/6113
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor(services/webhdfs): Refactor raw request send in writer and backend [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #6113:
URL: https://github.com/apache/opendal/pull/6113#issuecomment-2833531265
Please address the conflicts, thank you!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor(services/webhdfs): Refactor raw request send in writer and backend [opendal]
Posted by "jorgehermo9 (via GitHub)" <gi...@apache.org>.
jorgehermo9 commented on PR #6113:
URL: https://github.com/apache/opendal/pull/6113#issuecomment-2833603490
Done @Xuanwo , thanks for the review!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor(services/webhdfs): Refactor raw request send in writer and backend [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #6113:
URL: https://github.com/apache/opendal/pull/6113
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor(services/webhdfs): Refactor raw request send in writer and backend [opendal]
Posted by "jorgehermo9 (via GitHub)" <gi...@apache.org>.
jorgehermo9 commented on PR #6113:
URL: https://github.com/apache/opendal/pull/6113#issuecomment-2833599805
> Please address the conflicts, thank you!
Done @Xuanwo, thanks for the review!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor(services/webhdfs): Refactor raw request send in writer and b… [opendal]
Posted by "jorgehermo9 (via GitHub)" <gi...@apache.org>.
jorgehermo9 commented on code in PR #6113:
URL: https://github.com/apache/opendal/pull/6113#discussion_r2062667641
##########
core/src/services/webhdfs/core.rs:
##########
@@ -161,37 +188,13 @@ impl WebhdfsCore {
}
}
- pub async fn webhdfs_rename_object(&self, from: &str, to: &str) -> Result<Response<Buffer>> {
- let from = build_abs_path(&self.root, from);
- let to = build_rooted_abs_path(&self.root, to);
-
- let mut url = format!(
- "{}/webhdfs/v1/{}?op=RENAME&destination={}",
- self.endpoint,
- percent_encode_path(&from),
- percent_encode_path(&to)
- );
- if let Some(user) = &self.user_name {
- url += format!("&user.name={user}").as_str();
- }
- if let Some(auth) = &self.auth {
- url += &format!("&{auth}");
- }
-
- let req = Request::put(&url)
- .body(Buffer::new())
- .map_err(new_request_build_error)?;
-
- self.info.http_client().send(req).await
- }
-
- pub fn webhdfs_append_request(
+ pub async fn webhdfs_append(
&self,
- location: &str,
+ path: &str,
size: u64,
body: Buffer,
- ) -> Result<Request<Buffer>> {
- let mut url = location.to_string();
+ ) -> Result<Response<Buffer>> {
+ let mut url = self.webhdfs_init_append(path).await?;
Review Comment:
as `webhdfs_init_append` was only called just before `webhdfs_append` once, I moved it to be inside the `webhdfs_append` function

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor(services/webhdfs): Refactor raw request send in writer and b… [opendal]
Posted by "jorgehermo9 (via GitHub)" <gi...@apache.org>.
jorgehermo9 commented on code in PR #6113:
URL: https://github.com/apache/opendal/pull/6113#discussion_r2062667031
##########
core/src/services/webhdfs/core.rs:
##########
@@ -122,12 +124,37 @@ impl WebhdfsCore {
if let Some(content_type) = args.content_type() {
req = req.header(CONTENT_TYPE, content_type);
};
+
let req = req.body(body).map_err(new_request_build_error)?;
- Ok(req)
+ self.info.http_client().send(req).await
+ }
+
+ pub async fn webhdfs_rename_object(&self, from: &str, to: &str) -> Result<Response<Buffer>> {
Review Comment:
Moved the functions so `webhdfs_init_append` is next to `webhdfs_append`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor(services/webhdfs): Refactor raw request send in writer and backend [opendal]
Posted by "jorgehermo9 (via GitHub)" <gi...@apache.org>.
jorgehermo9 commented on PR #6113:
URL: https://github.com/apache/opendal/pull/6113#issuecomment-2833608621
Mistakenly closed this, sorry
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org