Skip to content
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

Consistently use GCP XML API #4207

Merged
merged 5 commits into from May 15, 2023
Merged

Consistently use GCP XML API #4207

merged 5 commits into from May 15, 2023

Conversation

tustvold
Copy link
Contributor

@tustvold tustvold commented May 11, 2023

Which issue does this PR close?

Relates to #2241
Relates to #3027
Closes #4209

Rationale for this change

We currently use a mixture of the XML and JSON APIs.

The XML API is more complete, supporting the full set of request preconditions, list offsets, etc... and so we should just switch over. As an added bonus this allows for code sharing between the implementations.

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the object-store Object Store Interface label May 11, 2023
@tustvold
Copy link
Contributor Author

There appear to be some emulator quirks... Will fix tomorrow...

@tustvold tustvold marked this pull request as draft May 11, 2023 22:44
@@ -118,69 +118,6 @@ impl From<Error> for crate::Error {
}
}

#[derive(Debug, Deserialize)]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just moved into list.rs so it can be shared with the gcs implementation

@tustvold
Copy link
Contributor Author

It would appear that fake-gcs-server doesn't properly support the XML APIs... - fsouza/fake-gcs-server#331

@@ -96,7 +96,7 @@ jobs:

- name: Configure Fake GCS Server (GCP emulation)
run: |
docker run -d -p 4443:4443 fsouza/fake-gcs-server -scheme http
docker run -d -p 4443:4443 tustvold/fake-gcs-server -scheme http -backend memory -public-host localhost:4443
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we please leave a link to that PR as a comment (so we now we can update it back when it is accepted upstream)?

@tustvold tustvold marked this pull request as ready for review May 12, 2023 16:25
@@ -639,12 +614,6 @@ impl ObjectStore for GoogleCloudStorage {
}

async fn get_opts(&self, location: &Path, options: GetOptions) -> Result<GetResult> {
if options.if_modified_since.is_some() || options.if_unmodified_since.is_some() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can now support this 🎉

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks like a nice cleanup to me -- I read the PR and it all made sense to me.

I am not an expert in the various object store APIs so I probably wouldn't catch some subtle API misuse, but all in all it looks like a nice improvement to me

Thank you @tustvold

@@ -96,7 +96,7 @@ jobs:

- name: Configure Fake GCS Server (GCP emulation)
run: |
docker run -d -p 4443:4443 fsouza/fake-gcs-server -scheme http
docker run -d -p 4443:4443 tustvold/fake-gcs-server -scheme http -backend memory -public-host localhost:4443
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we please leave a link to that PR as a comment (so we now we can update it back when it is accepted upstream)?

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks like a nice cleanup to me -- I read the PR and it all made sense to me.

I am not an expert in the various object store APIs so I probably wouldn't catch some subtle API misuse, but all in all it looks like a nice improvement to me

Thank you @tustvold

@tustvold tustvold merged commit 108b7a8 into apache:master May 15, 2023
28 checks passed
@tustvold tustvold mentioned this pull request May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
object-store Object Store Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use XML API for GCS
2 participants