Skip to content

Add disableGzipContent option for create from InputStream - #7057

Closed
nblair wants to merge 2 commits into
googleapis:masterfrom
nblair:blobwriteoption-disableGzipCompression
Closed

Add disableGzipContent option for create from InputStream#7057
nblair wants to merge 2 commits into
googleapis:masterfrom
nblair:blobwriteoption-disableGzipCompression

Conversation

@nblair

Copy link
Copy Markdown

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.
@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 18, 2019
@athakorathakor added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 19, 2019
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 19, 2019
@codecov

codecovBot commented Dec 19, 2019

Copy link
Copy Markdown

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 FilesCoverage ΔComplexity Δ
...rc/main/java/com/google/cloud/storage/Storage.java79.5% <100%> (+0.11%)0 <0> (ø)⬇️
...oogle/cloud/spanner/jdbc/SingleUseTransaction.java86% <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.

return new BlobWriteOption(Option.USER_PROJECT, userProject);
}

public static BlobWriteOption disableGzipContent() {

Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

@athakorathakor closed this Feb 28, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@nblair@athakor@googlebot@yoshi-kokoro