grpc: Index | Files

package edsbalancer

import ""

Package edsbalancer implements a balancer to handle EDS responses.


Package Files

balancergroup.go edsbalancer.go priority.go util.go

type EDSBalancer Uses

type EDSBalancer struct {
    // contains filtered or unexported fields

EDSBalancer does load balancing based on the EDS responses. Note that it doesn't implement the balancer interface. It's intended to be used by a high level balancer implementation.

The localities are picked as weighted round robin. A configurable child policy is used to manage endpoints in each locality.

func NewXDSBalancer Uses

func NewXDSBalancer(cc balancer.ClientConn, loadStore lrs.Store) *EDSBalancer

NewXDSBalancer create a new EDSBalancer.

func (*EDSBalancer) Close Uses

func (xdsB *EDSBalancer) Close()

Close closes the balancer.

func (*EDSBalancer) HandleChildPolicy Uses

func (xdsB *EDSBalancer) HandleChildPolicy(name string, config json.RawMessage)

HandleChildPolicy updates the child balancers handling endpoints. Child policy is roundrobin by default. If the specified balancer is not installed, the old child balancer will be used.

HandleChildPolicy and HandleEDSResponse must be called by the same goroutine.

func (*EDSBalancer) HandleEDSResponse Uses

func (xdsB *EDSBalancer) HandleEDSResponse(edsResp *xdsclient.EDSUpdate)

HandleEDSResponse handles the EDS response and creates/deletes localities and SubConns. It also handles drops.

HandleChildPolicy and HandleEDSResponse must be called by the same goroutine.

func (*EDSBalancer) HandleSubConnStateChange Uses

func (xdsB *EDSBalancer) HandleSubConnStateChange(sc balancer.SubConn, s connectivity.State)

HandleSubConnStateChange handles the state change and update pickers accordingly.

Package edsbalancer imports 20 packages (graph) and is imported by 1 packages. Updated 2019-11-24. Refresh now. Tools for package owners.