GeezerVison is showing github.com — Add batch get, update, delete methods to Storage and Blob by mziccard · Pull Request #233 · googleapis/google-cloud-java
Conversation
This PR follows the discussion in #219.
It adds get, update and delete methods that simplify doing batch gets/updates/deletes. Methods are added to both Storage and Blob.
Both unit and integration tests are added.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
- Update StorageRpc.BatchRequest to check for null to* lists
- Add storage.get, storage.update and storage.delete methods
- Add unit tests to StorageImplTest
- Add integration tests to ITStorageTest
- add delete, update and get methods to Blob class
- add tests to BlobTest
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Do you think we should also add similar methods to Bucket (e.g. for Bucket.update)?
Now, I noticed that we have Bucket.getAll(String...) and I wonder if signature should be changed to Bucket.get(String, String...)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The methods in Blob have more sense as they provide a nicer interface to a useful mechanism (batch requests) to enforce its usage. Adding the methods to Bucket is only syntactic sugar (and I wonder even how much it could be used). I don't know, maybe we should add them anyway.
Yes we should probably change Bucket.getAll(String...) to Bucket.get(String, String...).
Should we do all of these in this PR?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Technically we could also add bucket modification/get to the batch but I agree a need for such feature is low. Lets leave it for now (can be added later if requested).
Doing Bucket.get(String, String...) in this PR seems fine to me.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
- Storage get, update and delete now use batch in service layer
- Blob/Storage get, update and delete always return immutable list
- Update javadocs with info on list immutability and access denied error
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I like it now (with the service-level batching and consistent, clean vararg) much better.
I commented about 2 issues regarding exceptions
I actually now re-thinking about the BlobId and wonder if it is actually worth adding it (and use it when appropriate instead of BlobInfo, e.g. in delete[s], get[s],...) provided we also provide the convenient methods (such as get(bucket, name), BlobInfo.builder(bucket, name),...) .
What do you think (in any case, clearly not for this PR)?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I fixed last isses.
As I said in #62 I think that BlobId will not provide major benefits to users. However, it might help to have more uniform APIs. I'll work on adding it tomorrow, I'll take care of keeping al convenience methods as:
storage.get(bucket, name)
BlobInfo.builder(bucket, name) (while dropping BlobInfo.of(bucket, name) in favor of BlobId.of(bucket, name)
storage.delete(bucket, name)
storage.reader(bucket, name)
I would also add an id() getter to BlobInfo without delete name() and bucket() so that to avoid writing info.id().name().
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Great, PR looks good and I think we are on the same page regarding #62.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
aozarov
added a commit
that referenced
this pull request
Oct 12, 2015
Add batch get, update, delete methods to Storage and Blob
github-actions Bot
pushed a commit
to suztomo/google-cloud-java
that referenced
this pull request
Jun 29, 2022
)
* chore: update dependencies for regapic
* add more dependencies and trigger comment
* update goldens
* fix indentation
* remove duplicate gax-httpjson dependency
* remove duplicated dependencies
Source-Link: googleapis/synthtool@fa54eb2
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:1ec28a46062b19135b11178ceee60231e5f5a92dab454e23ae0aab72cd875906
suztomo
pushed a commit
that referenced
this pull request
Mar 30, 2026
…o v1-rev20200927-1.30.10 (#233)
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [com.google.apis:google-api-services-storage](com/google/apis/google-api-services-storage) | patch | `v1-rev20200814-1.30.10` -> `v1-rev20200927-1.30.10` |
---
### Renovate configuration
:date: **Schedule**: At any time (no schedule defined).
:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-storage-nio).
lqiu96
pushed a commit
that referenced
this pull request
Apr 1, 2026
…o v1-rev20200927-1.30.10 (#233)
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [com.google.apis:google-api-services-storage](com/google/apis/google-api-services-storage) | patch | `v1-rev20200814-1.30.10` -> `v1-rev20200927-1.30.10` |
---
### Renovate configuration
:date: **Schedule**: At any time (no schedule defined).
:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-storage-nio).
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
api: storage
Issues related to the Cloud Storage API.
cla: yes
This human has signed the Contributor License Agreement.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|