MCPcopy
hub / github.com/grpc/grpc-go / ringhashBalancer

Struct ringhashBalancer

balancer/ringhash/ringhash.go:87–107  ·  balancer/ringhash/ringhash.go::ringhashBalancer

Source from the content-addressed store, hash-verified

85}
86
87type ringhashBalancer struct {
88 // The following fields are initialized at build time and read-only after
89 // that and therefore do not need to be guarded by a mutex.
90
91 // ClientConn is embedded to intercept UpdateState calls from the child
92 // endpointsharding balancer.
93 balancer.ClientConn
94 logger *grpclog.PrefixLogger
95 child balancer.Balancer
96
97 mu sync.Mutex
98 config *iringhash.LBConfig
99 inhibitChildUpdates bool
100 shouldRegenerateRing bool
101 endpointStates *resolver.EndpointMap[*endpointState]
102
103 // ring is always in sync with endpoints. When endpoints change, a new ring
104 // is generated. Note that address weights updates also regenerates the
105 // ring.
106 ring *ring
107}
108
109// hashKey returns the hash key to use for an endpoint. Per gRFC A61, each entry
110// in the ring is a hash of the endpoint's hash key concatenated with a

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected