package endpointsharding
Import Path
google.golang.org/grpc/balancer/endpointsharding (on go.dev)
Dependency Relation
imports 8 packages, and imported by one package
Involved Source Files
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.
Package-Level Type Names (total 4)
ChildBuilderFunc creates a new balancer with the ClientConn. It has the same
type as the balancer.Builder.Build method.
func NewBalancer(cc balancer.ClientConn, opts balancer.BuildOptions, childBuilder ChildBuilderFunc, esOpts Options) balancer.Balancer
ChildState is the balancer state of a child along with the endpoint which
identifies the child balancer.
Balancer exposes only the ExitIdler interface of the child LB policy.
Other methods of the child policy are called only by endpointsharding.
Endpoint resolver.Endpoint
State balancer.State
func ChildStatesFromPicker(picker balancer.Picker) []ChildState
ExitIdler provides access to only the ExitIdle method of the child balancer.
ExitIdle instructs the LB policy to reconnect to backends / exit the
IDLE state, if appropriate and possible. Note that SubConns that enter
the IDLE state will not reconnect until SubConn.Connect is called.
google.golang.org/grpc/balancer.Balancer (interface)
google.golang.org/grpc/balancer.ExitIdler (interface)
*google.golang.org/grpc/internal/balancer/gracefulswitch.Balancer
ExitIdler : google.golang.org/grpc/balancer.ExitIdler
Options are the options to configure the behaviour of the
endpointsharding balancer.
DisableAutoReconnect allows the balancer to keep child balancer in the
IDLE state until they are explicitly triggered to exit using the
ChildState obtained from the endpointsharding picker. When set to false,
the endpointsharding balancer will automatically call ExitIdle on child
connections that report IDLE.
func NewBalancer(cc balancer.ClientConn, opts balancer.BuildOptions, childBuilder ChildBuilderFunc, esOpts Options) balancer.Balancer
Package-Level Functions (total 2)
ChildStatesFromPicker returns the state of all the children managed by the
endpoint sharding balancer that created this picker.
NewBalancer returns a load balancing policy that manages homogeneous child
policies each owning a single endpoint. The endpointsharding balancer
forwards the LoadBalancingConfig in ClientConn state updates to its children.
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |