Conversation
|
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
|
|
||
| // The directory prefix. All objects in the bucket with this prefix will have their metadata | ||
| // updated | ||
| // String objectName = "your-object-name"; |
There was a problem hiding this comment.
Is this supposed to be directoryPrefix?
There was a problem hiding this comment.
Good catch, thanks!
|
|
||
| // Add all blobs with the given prefix to the batch request | ||
| for (Blob blob : blobs.iterateAll()) { | ||
| batchRequest.update(blob.toBuilder().setMetadata(newMetadata).build()); |
There was a problem hiding this comment.
Is there a max number of updates you can put into a batch? If someones has lots of objects I could imagine this possibly resulting in an error.
There was a problem hiding this comment.
According to the docs, "You should not include more than 100 calls in a single batch request. If you need to make more calls than that, use multiple batch requests. The total batch request payload must be less than 10MB."
Should i put a note about that in the comments?
There was a problem hiding this comment.
I would recommend limiting the batch operation to 100 calls per batch operation / submit combination.
Might be overkill though?
There was a problem hiding this comment.
@frankyn Like, in this sample? Or do you mean update the actual batch code?
There was a problem hiding this comment.
This is more of a question; do you know if the Batch client will handle batch requests correctly if there are more than 100 requests?
Otherwise LGTM.
|
@frankyn this good to merge? |
|
|
||
| // Add all blobs with the given prefix to the batch request | ||
| for (Blob blob : blobs.iterateAll()) { | ||
| batchRequest.update(blob.toBuilder().setMetadata(newMetadata).build()); |
There was a problem hiding this comment.
This is more of a question; do you know if the Batch client will handle batch requests correctly if there are more than 100 requests?
Otherwise LGTM.
|
Thanks for your work, Jesse! |
Adds a sample for making a batch request, internal bug 121151093