-
Notifications
You must be signed in to change notification settings - Fork 183
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
Deprecate one-way boolean settings on builders #1750
Conversation
Motivation: Some builder APIs allow disabling some feature without the option to enable it. To keep the builders' APIs consistent all boolean settings should accept a flag that can trigger the feature to on or off configuration. This change deprecates the undesired methods and adds methods that accept a boolean. Modifications: - Deprecated `GrpcClientBuilder.disableHostHeaderFallback` in favor of `GrpcClientBuilder.hostHeaderFallback(boolean)`, - Deprecated `GrpcClientBuilder.disableDrainingRequestPayloadBody` in favor of `GrpcClientBuilder.drainRequestPayloadBody(boolean)`, - Deprecated `HttpReporter.Builder.disableSpanBatching` in favor of `HttpReporter.Builder.spansBatchingEnabled(boolean)`, - Deprecated `HttpServerBuilder.disableDrainingRequestPayloadBody` in favor of `HttpServerBuilder.drainRequestPayloadBody(boolean)`, - Deprecated `SingleAddressHttpClientBuilder.disableHostHeaderFallback` in favor of `SingleAddressHttpClientBuilder.hostHeaderFallback(boolean)`. Result: More consistent builders' APIs.
...blisher/src/main/java/io/servicetalk/opentracing/zipkin/publisher/reporter/HttpReporter.java
Outdated
Show resolved
Hide resolved
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.
lgtm after javadoc fix and rebase
servicetalk-grpc-api/src/main/java/io/servicetalk/grpc/api/GrpcClientBuilder.java
Outdated
Show resolved
Hide resolved
servicetalk-grpc-api/src/main/java/io/servicetalk/grpc/api/GrpcClientBuilder.java
Outdated
Show resolved
Hide resolved
servicetalk-grpc-api/src/main/java/io/servicetalk/grpc/api/GrpcClientBuilder.java
Outdated
Show resolved
Hide resolved
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.
Last comments than LGTM:
*/ | ||
public GrpcClientBuilder<U, R> hostHeaderFallback(boolean enable) { | ||
throw new UnsupportedOperationException("Setting automatic host header fallback using this method" + | ||
" is not yet supported."); |
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.
In the other PR @bondolo used getClass().getSimpleName()
: https://github.com/apple/servicetalk/pull/1781/files#diff-fa20d1d978b59de34bb9649cc6cc21ba5321886ccaa29636bbc285eea14eb07aR332
Consider using getClass().getName()
moving forward. It will help users understand who they should contact if this method is not implemented.
...ttp-netty/src/main/java/io/servicetalk/http/netty/DefaultSingleAddressHttpClientBuilder.java
Outdated
Show resolved
Hide resolved
527af0a
to
4598764
Compare
Deprecate one-way boolean settings on builders Motivation: Some builder APIs allow disabling some feature without the option to enable it. To keep the builders' APIs consistent all boolean settings should accept a flag that can trigger the feature to on or off configuration. This change deprecates the undesired methods and adds methods that accept a boolean. Modifications: - Deprecated `GrpcClientBuilder.disableHostHeaderFallback` in favor of `GrpcClientBuilder.hostHeaderFallback(boolean)`, - Deprecated `GrpcClientBuilder.disableDrainingRequestPayloadBody` in favor of `GrpcClientBuilder.drainRequestPayloadBody(boolean)`, - Deprecated `HttpReporter.Builder.disableSpanBatching` in favor of `HttpReporter.Builder.spansBatchingEnabled(boolean)`, - Deprecated `HttpServerBuilder.disableDrainingRequestPayloadBody` in favor of `HttpServerBuilder.drainRequestPayloadBody(boolean)`, - Deprecated `SingleAddressHttpClientBuilder.disableHostHeaderFallback` in favor of `SingleAddressHttpClientBuilder.hostHeaderFallback(boolean)`. Result: More consistent builders' APIs.
Deprecate one-way boolean settings on builders Motivation: Some builder APIs allow disabling some feature without the option to enable it. To keep the builders' APIs consistent all boolean settings should accept a flag that can trigger the feature to on or off configuration. This change deprecates the undesired methods and adds methods that accept a boolean. Modifications: - Deprecated `GrpcClientBuilder.disableHostHeaderFallback` in favor of `GrpcClientBuilder.hostHeaderFallback(boolean)`, - Deprecated `GrpcClientBuilder.disableDrainingRequestPayloadBody` in favor of `GrpcClientBuilder.drainRequestPayloadBody(boolean)`, - Deprecated `HttpReporter.Builder.disableSpanBatching` in favor of `HttpReporter.Builder.spansBatchingEnabled(boolean)`, - Deprecated `HttpServerBuilder.disableDrainingRequestPayloadBody` in favor of `HttpServerBuilder.drainRequestPayloadBody(boolean)`, - Deprecated `SingleAddressHttpClientBuilder.disableHostHeaderFallback` in favor of `SingleAddressHttpClientBuilder.hostHeaderFallback(boolean)`. Result: More consistent builders' APIs.
Motivation:
Some builder APIs allow disabling some feature without the option to
enable it. To keep the builders' APIs consistent all boolean settings
should accept a flag that can trigger the feature to on or off
configuration. This change deprecates the undesired methods and adds
methods that accept a boolean.
Modifications:
GrpcClientBuilder.disableHostHeaderFallback
in favor ofGrpcClientBuilder.hostHeaderFallback(boolean)
,GrpcClientBuilder.disableDrainingRequestPayloadBody
infavor of
GrpcClientBuilder.drainRequestPayloadBody(boolean)
,HttpReporter.Builder.disableSpanBatching
in favor ofHttpReporter.Builder.spansBatchingEnabled(boolean)
,HttpServerBuilder.disableDrainingRequestPayloadBody
infavor of
HttpServerBuilder.drainRequestPayloadBody(boolean)
,SingleAddressHttpClientBuilder.disableHostHeaderFallback
in favor of
SingleAddressHttpClientBuilder.hostHeaderFallback(boolean)
.Result:
More consistent builders' APIs.