Lines Matching refs:Balancer
33 "google.golang.org/grpc/balancer"
34 _ "google.golang.org/grpc/balancer/roundrobin" // To register roundrobin.
71 // errBalancerClosed indicates that the balancer is closed.
72 errBalancerClosed = errors.New("grpc: balancer is closed")
111 // This is used by v1 balancer dial option WithBalancer to support v1
112 // balancer, and also by WithBalancerName dial option.
113 balancerBuilder balancer.Builder
223 // WithBalancer returns a DialOption which sets a load balancer with the v1 API.
226 // Deprecated: use the new balancer APIs in balancer package and WithBalancerName.
227 func WithBalancer(b Balancer) DialOption {
235 // WithBalancerName sets the balancer that the ClientConn will be initialized
236 // with. Balancer registered with balancerName will be used. This function
237 // panics if no balancer was registered by balancerName.
239 // The balancer cannot be overridden by balancer option specified by service
244 builder := balancer.Get(balancerName)
246 panic(fmt.Sprintf("grpc.WithBalancerName: no balancer is registered for name %v", balancerName))
597 cc.balancerBuildOpts = balancer.BuildOptions{
612 // those to balancer. Balancer creates new addrConn. addrConn fails to
688 balancerBuildOpts balancer.BuildOptions
699 preBalancerName string // previous balancer name.
767 // Only look at balancer types and switch balancer if balancer dial
781 // non-grpclb balancer.
783 // If current balancer is grpclb, switch to the previous one.
798 // Balancer dial option was set, and this is the first time handling
799 // resolved addresses. Build a balancer with dopts.balancerBuilder.
806 // switchBalancer starts the switching from current balancer to the balancer
809 // It will NOT send the current address list to the new balancer. If needed,
810 // caller of this function should send address list to the new balancer after
823 grpclog.Infof("ClientConn switching balancer to %q", name)
825 grpclog.Infoln("ignoring balancer switching: Balancer DialOption used instead")
836 builder := balancer.Get(name)
838 grpclog.Infof("failed to get balancer builder for: %v, using pick_first instead", name)
846 func (cc *ClientConn) handleSubConnStateChange(sc balancer.SubConn, s connectivity.State) {
852 // TODO(bar switching) send updates to all balancer wrappers when balancer
1015 func (cc *ClientConn) getTransport(ctx context.Context, failfast bool) (transport.ClientTransport, func(balancer.DoneInfo), error) {
1016 t, done, err := cc.blockingpicker.pick(ctx, failfast, balancer.PickOptions{})
1036 if sc.LB != nil && *sc.LB != grpclbName { // "grpclb" is not a valid balancer option in service config.
1038 // If current balancer is grpclb, there's at least one grpclb
1039 // balancer address in the resolved list. Don't switch the balancer,
1040 // but change the previous balancer name, so if a new resolved
1041 balancer will be
1121 acbw balancer.SubConn
1451 // iv) transport is in connectivity.TransientFailure and there is a balancer/failfast is true.
1458 // RPC is failfast or balancer is nil. This RPC should fail with ac.tearDownErr.
1528 // ii) there are concurrent name resolver/Balancer triggered