Skip to content

Comments

refactor(services/webhdfs): Refactor raw request send in writer and backend#6113

Merged
Xuanwo merged 2 commits intoapache:mainfrom
jorgehermo9:webhdfs-refactor-core
Apr 28, 2025
Merged

refactor(services/webhdfs): Refactor raw request send in writer and backend#6113
Xuanwo merged 2 commits intoapache:mainfrom
jorgehermo9:webhdfs-refactor-core

Conversation

@jorgehermo9
Copy link
Contributor

@jorgehermo9 jorgehermo9 commented Apr 27, 2025

Now all self.info.http_client().send(req).await happen in core.rs.


This is the last one of these PRs, I swear!!

self.info.http_client().send(req).await
}

pub async fn webhdfs_rename_object(&self, from: &str, to: &str) -> Result<Response<Buffer>> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the functions so webhdfs_init_append is next to webhdfs_append

}

fn webhdfs_open_request(&self, path: &str, range: &BytesRange) -> Result<Request<Buffer>> {
pub async fn webhdfs_list_status(&self, path: &str) -> Result<Response<Buffer>> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :/

) -> Result<Request<Buffer>> {
let mut url = location.to_string();
) -> Result<Response<Buffer>> {
let mut url = self.webhdfs_init_append(path).await?;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as webhdfs_init_append was only called just before webhdfs_append once, I moved it to be inside the webhdfs_append function
image

@jorgehermo9 jorgehermo9 changed the title refactor(services/webhdfs): Refactor raw request send in writer and b… refactor(services/webhdfs): Refactor raw request send in writer and backend Apr 27, 2025
@jorgehermo9 jorgehermo9 marked this pull request as ready for review April 27, 2025 16:08
@jorgehermo9 jorgehermo9 requested a review from Xuanwo as a code owner April 27, 2025 16:08
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. releases-note/refactor The PR does a refactor on code or has a title that begins with "refactor" labels Apr 27, 2025
Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this change!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 27, 2025
@Xuanwo
Copy link
Member

Xuanwo commented Apr 27, 2025

Please address the conflicts, thank you!

@jorgehermo9
Copy link
Contributor Author

Done @Xuanwo , thanks for the review!

@jorgehermo9 jorgehermo9 deleted the webhdfs-refactor-core branch April 27, 2025 19:34
@jorgehermo9 jorgehermo9 restored the webhdfs-refactor-core branch April 27, 2025 19:35
@jorgehermo9 jorgehermo9 reopened this Apr 27, 2025
@jorgehermo9
Copy link
Contributor Author

Mistakenly closed this, sorry

@Xuanwo Xuanwo merged commit 84f7d1f into apache:main Apr 28, 2025
188 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer releases-note/refactor The PR does a refactor on code or has a title that begins with "refactor" size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants