FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add support for blob rewrite by mziccard · Pull Request #294 · googleapis/google-cloud-java · GitHub

Add support for blob rewrite - #294

Merged
aozarov merged 6 commits into
googleapis:masterfrom
mziccard:add-support-for-rewrite
Oct 29, 2015
Merged

Add support for blob rewrite#294
aozarov merged 6 commits into
googleapis:masterfrom
mziccard:add-support-for-rewrite

Conversation

Copy link
Copy Markdown
Contributor

This follows from #291. Main changes are:

  • Add rewrite method to StorageRpc and DefaultStorageRpc
  • Add BlobRewriter class to wrap multiple rewrite requests
  • Add rewriter method to Storage and StorageImpl that returns a BlobRewriter
  • Add unit and integration tests

mziccard added the api: storage Issues related to the Cloud Storage API. label Oct 26, 2015
googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 26, 2015

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

- Add rewrite method to StorageRpc and DefaultStorageRpc
- Add rewriter method to Storage and StorageImpl
- Add unit and integration tests
- Split StorageRpc.rewrite into openRewrite and continueRewrite
- Add StorageRpc.RewriteResponse and RewriteRequest classe
- Move first rewrite request from BlobRewriter to StorageImpl
- Change maxBytesRewrittenPerCall to megabytesRewrittenPerCall
- Change BlobWriter.blobSize for BigInteger to Long
- BlobRewriter extends Restorable
- Refactor tests and add StorageImpl unit tests
- rename BlobRewriter to CopyWriter
- update Storage.copy and Blob.copyTo methods to use StorageRpc.openRewrite
- update Blob and Storage unit and intergration tests
- update StorageExample
mziccard force-pushed the add-support-for-rewrite branch from 0b77a08 to 43460b9 Compare October 28, 2015 14:57

Copy link
Copy Markdown
Contributor Author

@aozarov I addressed all comments:

  • split StorageRpc.rewrite into StorageRpc.openRewrite and StorageRpc.openRewrite
  • use StorageRpc.openRewrite and StorageRpc.openRewrite to implement copy in Storage and Blob
  • remane BlobRewriter to CopyWriter
  • update and add tests
  • update example

I also noticed that rewrite (in contrast with copy) fails if no content type is specified for the destination object.

storage.copy(CopyRequest.of("bucket", "n1", BlobInfo.builder("bucket", "n2").build()));

fails with:

{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "You must specify the content type of the destination object."
}
],
"code": 400,
"message": "You must specify the content type of the destination object."
}
}

Maybe @Capstan can confirm this?
I updated StorageExample to take a content type parameter for cp.

aozarov commented Oct 28, 2015

Copy link
Copy Markdown
Contributor

@mziccard I tried to reproduce the content-type requirement using the API Explorer but for me it worked fine without supplying it.

Copy link
Copy Markdown
Contributor Author

@aozarov My bad, I was providing a storage object in the request body even though it had no contentType, forgot to add the check. I'm fixing this.

This comment was marked as spam.

This comment was marked as spam.

Copy link
Copy Markdown
Contributor Author

Last comments addressed, thanks @aozarov for the thorough review!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL