-
Notifications
You must be signed in to change notification settings - Fork 4k
Adds Grpc.newManagedChannel(String, ChannelCredentials, NameResolverR… #11901
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
base: master
Are you sure you want to change the base?
Changes from all commits
b2edb33
2b152ad
439946f
8b75736
7e2c891
4ee3512
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,8 @@ | |
| import io.grpc.HttpConnectProxiedSocketAddress; | ||
| import io.grpc.Internal; | ||
| import io.grpc.ManagedChannelBuilder; | ||
| import io.grpc.NameResolverProvider; | ||
| import io.grpc.NameResolverRegistry; | ||
| import io.grpc.internal.AtomicBackoff; | ||
| import io.grpc.internal.ClientTransportFactory; | ||
| import io.grpc.internal.ConnectionClientTransport; | ||
|
|
@@ -708,6 +710,24 @@ NettyChannelBuilder setTransportTracerFactory(TransportTracer.Factory transportT | |
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the registry used for looking up name resolvers. | ||
| */ | ||
| @CanIgnoreReturnValue | ||
| public NettyChannelBuilder nameResolverRegistry(NameResolverRegistry registry) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The purpose of us adding this new API is so that people can't change the name resolver after creating the builder. So it defeats the purpose to add new public methods. We should use a separate constructor, because we'll want to disallow changing the nameResolverFactory when using the API to pass the registry. |
||
| managedChannelImplBuilder.nameResolverRegistry(registry); | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the {@link io.grpc.NameResolverProvider} to use. | ||
| */ | ||
| @CanIgnoreReturnValue | ||
| public NettyChannelBuilder nameResolverProvider(NameResolverProvider provider) { | ||
| managedChannelImplBuilder.nameResolverProvider(provider); | ||
| return this; | ||
| } | ||
|
|
||
| static Collection<Class<? extends SocketAddress>> getSupportedSocketAddressTypes() { | ||
| return Collections.singleton(InetSocketAddress.class); | ||
| } | ||
|
|
||
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.
Why go through this code block if you will ignore the result?