Documentation ¶
Overview ¶
Package endpointsharding implements a load balancing policy that manages homogeneous child policies each owning a single endpoint.
Experimental ¶
Notice: This package is EXPERIMENTAL and may be changed or removed in a later release.
Index ¶
Constants ¶
const PickFirstConfig = "[{\"pick_first\": {}}]"
PickFirstConfig is a pick first config without shuffling enabled.
Variables ¶
This section is empty.
Functions ¶
func NewBalancer ¶
func NewBalancer(cc balancer.ClientConn, opts balancer.BuildOptions) balancer.Balancer
NewBalancer returns a load balancing policy that manages homogeneous child policies each owning a single endpoint.
func ParseConfig ¶
func ParseConfig(cfg json.RawMessage) (serviceconfig.LoadBalancingConfig, error)
ParseConfig parses a child config list and returns an LB config to use with the endpointsharding balancer.
cfg is expected to be a JSON array of LB policy names + configs as the format of the loadBalancingConfig field in ServiceConfig.
Types ¶
type ChildState ¶
ChildState is the balancer state of a child along with the endpoint which identifies the child balancer.
func ChildStatesFromPicker ¶
func ChildStatesFromPicker(picker balancer.Picker) []ChildState
ChildStatesFromPicker returns the state of all the children managed by the endpoint sharding balancer that created this picker.