add disableGzipContent option for create from InputStream #82
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Is your feature request related to a problem? Please describe.
I have a use case that necessitates using the Storage/Bucket write method variants with InputStream arguments. The inputs for my use case to store in Cloud Storage are:
Describe the solution you'd like
Given that our content is already compressed, I would prefer to avoid spending the CPU time on compressing the content again en route to the Bucket.
Describe alternatives you've considered
We have used the
byte[]variants, withBlobTargetOption.disableGzipContentand the Compose request. This is suitable but leaves us with a tuning challenge:byte[]chunks) requires additional heap space be available32 * bufferSize, we will upload 31 small sized chunks and 1 large chunk that we have to use theInputStreamvariant for anyways, and pay the additional overhead of gzip compression.Additional context
I have done some exploration and it appears that the values on the BlobWriteOption (used on
InputStreamvariants) and BlobTargetOption (used onbyte[]variants) enums both are translated intoStorageRpc.Option. I have a small contribution to offer in the form of a pull request to follow.Fixes #36; ported from googleapis/google-cloud-java#7057