-
Notifications
You must be signed in to change notification settings - Fork 373
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
feat(common): add GrpcCompressionAlgorithmOption #13108
Conversation
Add a common option to set the gRPC compression algorithm, which can be used at both the client and individual-operation levels. (Previously, users could only affect client-to-server compression at the connection level, using `GrpcChannelArgumentsNativeOption`.) - It will take precedence over any compression algorithm set by the `internal::GrpcSetupOption` function. - The `pubsub::CompressionAlgorithmOption` takes precedence over any other settings during `AsyncPublish()` calls when the request-size threshold is met. Exercise the new option in the Spanner client in two ways: - A new `ConnectionImpl` test to check that the compression algorithm from the prevailing options is reflected in the `grpc::ClientContext` passed to the stub. - Setting the compression algorithm used during the client integration tests, but overriding it on a few operations. (We can't directly observe the effect, but we've done our part.)
170391d
to
d9ef78f
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #13108 +/- ##
=======================================
Coverage 92.99% 92.99%
=======================================
Files 2135 2135
Lines 185608 185637 +29
=======================================
+ Hits 172601 172632 +31
+ Misses 13007 13005 -2
☔ View full report in Codecov by Sentry. |
@@ -135,6 +139,7 @@ TEST(DefaultBatchSinkTest, BasicWithCompression) { | |||
std::move(mock), background.cq(), | |||
DefaultPublisherOptions( | |||
pubsub_testing::MakeTestOptions() | |||
.set<GrpcCompressionAlgorithmOption>(GRPC_COMPRESS_NONE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alevenberg maybe we should consider using pubsub::CompressionAlgorithmOption = google::cloud::GrpcCompressionAlgorithmOption;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That might be problematic, given that pubsub::CompressionAlgorithmOption
is given a default value (of GRPC_COMPRESS_DEFLATE
).
Add a common option to set the gRPC compression algorithm, which can be used at both the client and individual-operation levels. (Previously, users could only affect client-to-server compression at the connection level, using
GrpcChannelArgumentsNativeOption
.)It will take precedence over any compression algorithm set by the
internal::GrpcSetupOption
function.The
pubsub::CompressionAlgorithmOption
takes precedence over any other settings duringAsyncPublish()
calls when the request-size threshold is met.Exercise the new option in the Spanner client in two ways:
ConnectionImpl
test to check that the compression algorithm from the prevailing options is reflected in thegrpc::ClientContext
passed to the stub.This change is