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

feat: Add abort() to writer by dmitry-fa · Pull Request #460 · googleapis/java-storage · GitHub

feat: Add abort() to writer - #460

Closed
dmitry-fa wants to merge 1 commit into
googleapis:masterfrom
dmitry-fa:abort3
Closed

feat: Add abort() to writer#460
dmitry-fa wants to merge 1 commit into
googleapis:masterfrom
dmitry-fa:abort3

Conversation

Copy link
Copy Markdown
Contributor

Fixes googleapis/java-core#202
The current implementation is not elegant, because one has to call storage.abort(writer) to cancel resumable upload.
Once googleapis/google-cloud-java#9101 is implemented (I hope it will be implemented sooner or later), we need just to rename private cancelUpload() method of BlobWriteChannel to public void abort().

google-cla Bot commented Aug 10, 2020

Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

google-cla Bot added the cla: no This human has *not* signed the Contributor License Agreement. label Aug 10, 2020

codecov Bot commented Aug 10, 2020
edited
Loading

Copy link
Copy Markdown

Codecov Report

Merging #460 into master will decrease coverage by 0.57%.
The diff coverage is 10.86%.

@@             Coverage Diff              @@
##             master     googleapis/java-core#460      +/-   ##
============================================
- Coverage     63.25%   62.68%   -0.58%     
+ Complexity      622      615       -7     
============================================
  Files            32       32              
  Lines          5144     5180      +36     
  Branches        491      479      -12     
============================================
- Hits           3254     3247       -7     
- Misses         1726     1765      +39     
- Partials        164      168       +4     
Impacted Files Coverage Δ Complexity Δ
...ava/com/google/cloud/storage/BlobWriteChannel.java 63.51% <0.00%> (-11.09%) 10.00 <0.00> (ø)
...rc/main/java/com/google/cloud/storage/Storage.java 80.64% <ø> (ø) 0.00 <0.00> (ø)
...om/google/cloud/storage/spi/v1/HttpStorageRpc.java 1.55% <0.00%> (-0.05%) 2.00 <0.00> (ø)
...ogle/cloud/storage/spi/v1/HttpStorageRpcSpans.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...va/com/google/cloud/storage/spi/v1/StorageRpc.java 66.23% <ø> (ø) 0.00 <0.00> (ø)
...ogle/cloud/storage/testing/StorageRpcTestBase.java 94.11% <0.00%> (-1.89%) 48.00 <0.00> (ø)
...ain/java/com/google/cloud/storage/StorageImpl.java 81.02% <100.00%> (+0.02%) 140.00 <2.00> (-7.00) ⬆️
...in/java/com/google/cloud/storage/StorageBatch.java 88.00% <0.00%> (-4.00%) 13.00% <0.00%> (ø%)
...main/java/com/google/cloud/storage/BucketInfo.java 81.69% <0.00%> (-0.32%) 86.00% <0.00%> (ø%)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f8d6e15...257317d. Read the comment docs.

google-cla Bot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Aug 10, 2020
dmitry-fa requested a review from frankyn August 10, 2020 17:08

Copy link
Copy Markdown
Contributor Author

New tests covering RPC code will be added after #454 is merged.

product-auto-label Bot added the api: storage Issues related to the googleapis/java-storage API. label Aug 21, 2020

@Override
public void abort(WriteChannel channel) {
if (!(channel instanceof BlobWriteChannel)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

why not make the method argument a BlobWriteChannel then?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@elharo BlobWriteChannel is a package-private class. If it were public we could invoke channel.abort() directly.

<method>com.google.cloud.storage.BucketInfo$Builder deleteLifecycleRules()</method>
<differenceType>7013</differenceType>
</difference>
<difference>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yet again, we're getting stuck because of excessive use of interfaces. Either there are multiple implementations of Storage and we shouldn't make this change or we should bite the bullet and combine Storage and StorageImpl once and for all. Ditto StorageRpc and HttpStorageRpc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@frankyn what do you think about combining Storage and StorageImpl?

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 googleapis/java-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.

[java-storage] Add abort() to writer

3 participants


Back | FazBrowse Home | New Git URL