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

Add disableGzipContent option for create from InputStream #7057

Closed

Conversation

nblair
Copy link

@nblair nblair commented Dec 18, 2019

Previously, only the methods to create blobs that take a byte[] argument offer the option to disable gzip compression; the methods that accept an InputStream argument do not. This is due to the BlobWriteOption enum missing a matching constant for BlobTargetOption.IF_DISABLE_GZIP_CONTENT.

This change set adds a matching IF_DISABLE_GZIP_CONTENT constant to BlobWriteOption including the correct translation to StorageRpc.Option. The net result is that the Storage create functions that accept an InputStream now offer the option to disable gzip compression.

Fixes #7056.

Previously, only the methods to create blobs that take a byte[] argument offer the option to disable gzip compression; the methods that accept an InputStream argument do not. This is due to the BlobWriteOption enum missing a matching constant for BlobTargetOption.IF_DISABLE_GZIP_CONTENT.

This change set adds a matching IF_DISABLE_GZIP_CONTENT constant to BlobWriteOption including the correct translation to StorageRpc.Option. The net result is that the Storage create functions that accept an InputStream now offer the option to disable gzip compression.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 18, 2019
@athakor athakor added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 19, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 19, 2019
@codecov
Copy link

codecov bot commented Dec 19, 2019

Codecov Report

Merging #7057 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #7057      +/-   ##
============================================
- Coverage     32.18%   32.18%   -0.01%     
+ Complexity     3698     3697       -1     
============================================
  Files           249      249              
  Lines         40371    40373       +2     
  Branches       6134     6134              
============================================
  Hits          12994    12994              
- Misses        26304    26305       +1     
- Partials       1073     1074       +1
Impacted Files Coverage Δ Complexity Δ
...rc/main/java/com/google/cloud/storage/Storage.java 79.5% <100%> (+0.11%) 0 <0> (ø) ⬇️
...oogle/cloud/spanner/jdbc/SingleUseTransaction.java 86% <0%> (-1%) 36% <0%> (-1%)

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 8befeef...98f8332. Read the comment docs.

@@ -699,6 +700,10 @@ public static BlobWriteOption kmsKeyName(String kmsKeyName) {
public static BlobWriteOption userProject(String userProject) {
return new BlobWriteOption(Option.USER_PROJECT, userProject);
}

public static BlobWriteOption disableGzipContent() {
Copy link
Author

Choose a reason for hiding this comment

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

Is a javadoc desired here? If so, what do you think of the text:

Returns an option that signals automatic gzip compression should not be performed en route to the bucket.

@athakor
Copy link
Contributor

athakor commented Feb 28, 2020

closing this PR as it's already merged in respective repo.

@athakor athakor closed this Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants