Package io.grpc
Class LoadBalancer.SubchannelPicker
- java.lang.Object
-
- io.grpc.LoadBalancer.SubchannelPicker
-
- Direct Known Subclasses:
LoadBalancer.ErrorPicker
,LoadBalancer.FixedResultPicker
- Enclosing class:
- LoadBalancer
@ThreadSafe @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1771") public abstract static class LoadBalancer.SubchannelPicker extends Object
The main balancing logic. It must be thread-safe. Typically it should only synchronize on its own state, and avoid synchronizing with the LoadBalancer's state.- Since:
- 1.2.0
-
-
Constructor Summary
Constructors Constructor Description SubchannelPicker()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract LoadBalancer.PickResult
pickSubchannel(LoadBalancer.PickSubchannelArgs args)
Make a balancing decision for a new RPC.void
requestConnection()
Deprecated.overrideLoadBalancer.requestConnection()
instead.
-
-
-
Method Detail
-
pickSubchannel
public abstract LoadBalancer.PickResult pickSubchannel(LoadBalancer.PickSubchannelArgs args)
Make a balancing decision for a new RPC.- Parameters:
args
- the pick arguments- Since:
- 1.3.0
-
requestConnection
@Deprecated public void requestConnection()
Deprecated.overrideLoadBalancer.requestConnection()
instead.Tries to establish connections now so that the upcoming RPC may then just pick a ready connection without having to connect first.No-op if unsupported.
- Since:
- 1.11.0
-
-