-
Notifications
You must be signed in to change notification settings - Fork 867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract Common Listing and Retrieval Functionality #4220
Conversation
@@ -302,89 +268,6 @@ impl S3Client { | |||
Ok(()) | |||
} | |||
|
|||
/// Make an S3 List request <https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html> | |||
async fn list_request( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just moved
@@ -169,40 +169,6 @@ impl S3Client { | |||
self.config.credentials.get_credential().await | |||
} | |||
|
|||
/// Make an S3 GET request <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html> | |||
pub async fn get_request( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is moved to be a trait implementation
} | ||
|
||
/// Perform a list operation automatically handling pagination | ||
pub fn list_paginated( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now implemented by ListClientExt
@@ -0,0 +1,85 @@ | |||
// or more contributor license agreements. See the NOTICE file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just moved from list.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The structure looks (really) nice to me. 🏅 work @tustvold
I think the new traits could do with some docs (maybe just pointing at the ObjectStore::
trait to explain their semantics) but otherwise 🚀 I think
) -> Result<(ListResult, Option<String>)> { | ||
assert!(offset.is_none()); // Not yet supported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should return an error rather than panic'ing I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is unreachable by the current code
use reqwest::Response; | ||
|
||
#[async_trait] | ||
pub trait GetClient: Send + Sync + 'static { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some this should have some comments / explination for what it is doing
@@ -346,22 +358,6 @@ impl AzureClient { | |||
|
|||
Ok((to_list_result(response, prefix)?, token)) | |||
} | |||
|
|||
/// Perform a list operation automatically handling pagination |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now implemented indirectly via ListClientExt
Which issue does this PR close?
Closes #.
Rationale for this change
Extracts common listing and get functionality from the various cloud ObjectStore. This ends up being more code, but avoids duplication and so I think is probably better, would appreciate any thoughts?
What changes are included in this PR?
Are there any user-facing changes?