-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Channel.authority() should return the value of overrideAuthority #2956
Conversation
FYI: most of the time we'll rebase instead of merging, and then squash before pushing to the master branch. |
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.
Remove the gradle-wrapper.jar change?
* functionality. | ||
*/ | ||
@VisibleForTesting | ||
protected static class OverrideAuthorityNameResolverFactory extends NameResolver.Factory { |
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.
package-private instead of protected?
@@ -308,6 +308,10 @@ public ManagedChannel build() { | |||
// getResource(), then this shouldn't be a problem unless called on the UI thread. | |||
nameResolverFactory = NameResolverProvider.asFactory(); | |||
} |
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.
Delete AuthorityOverridingTransportFactory?
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.
Didn't realize that this was all that AuthorityOverridingTransportFactory was trying to accomplish. Done.
|
||
/** | ||
* Constructor for the {@link NameResolver.Factory} | ||
* @param delegate The actual underlying factory that will produce the a {@link NameResolver} |
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.
Leave an empty line before the section with @param
and similar.
*/ | ||
@VisibleForTesting | ||
protected static class OverrideAuthorityNameResolverFactory extends NameResolver.Factory { | ||
final NameResolver.Factory delegate; |
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.
Private? Ditto for authorityOverride
.
|
||
import java.net.InetSocketAddress; | ||
import java.net.URI; | ||
import java.util.concurrent.TimeUnit; | ||
|
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.
Creating extra sections here is the old style. Now there are only two sections: static imports and normal imports.
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.
Make sure to squash
…should be private
1660ff7
to
d6f0926
Compare
AbstractManagedChannelImplBuilder accepts an overrideAuthority parameter, but this value is not hooked up to the name resolver object. Ultimately, Channel.authority consults with the NameResolver, so the overrideAuthority should be hooked into the NameResolverFactory, while all other functionality should be preserved.
Also, add unit tests for all the variants of OkHttpChannelBuilder and NettyChannelBuilder constructors, namely to test the slightly different NettyChannelBuilder(SocketAddress) code path.
Fixes #2682