grpc / grpc/grpc-java

Remove NameResolver.Factory

Aperta
#7,133 29 commenti 0 reazioni 1 assegnatario Rivendicata da @YifeiZhuang Vedi su GitHub
enhancement
Lingua principale
Java
Stelle
12.1k
Fork
4k
Merge medio
2g 17h
PR unite (30g)
37

Descrizione

`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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.