grpc / grpc/grpc-java

Remove NameResolver.Factory

オープン
#7,133 コメント 29 件 リアクション 0 件 担当者 1 名 @YifeiZhuang が担当を希望しています GitHub で見る
enhancement
主要言語
Java
スター
12.1k
フォーク
4k
平均マージ
2日 17時間
マージ済み PR(30日)
37

説明

`NameResolver.Factory` is old and was meant to be replaced by `NameResolverProvider`. I've been slowly trying to remove it, especially `ManagedChannelBuilder.nameResolverFactory()`. I see evidence new users are using it, so this issue is to be a gathering point for why it is being removed and making sure there are alternatives to the current usages.

Since NameResolverRegistry was added in v1.21, _most_ users shouldn't need the factory. A small number of users may need a "default name resolver override". This would be similar to `defaultLoadBalancingPolicy()` which was added when we removed `loadBalancerFactory()`. However, the NameResolver API needs tweaks to support that, where each NameResolver would be for a particular scheme and the NameResolverRegistry would select the appropriate NameResolver (instead of the current "call all the name resolvers in order until one understands the URI").

NameResolver.Factory is used internally in grpc. I don't care _much_ about that, since it does little harm, but I don't expect NameResolver.Factory to ever become stable and it _should_ be removed. It just may go slowly due to priorities.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。