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

Struct rlsPicker

balancer/rls/picker.go:53–74  ·  view source on GitHub ↗

rlsPicker selects the subConn to be used for a particular RPC. It does not manage subConns directly and delegates to pickers provided by child policies.

Source from the content-addressed store, hash-verified

51// rlsPicker selects the subConn to be used for a particular RPC. It does not
52// manage subConns directly and delegates to pickers provided by child policies.
53type rlsPicker struct {
54 // The keyBuilder map used to generate RLS keys for the RPC. This is built
55 // by the LB policy based on the received ServiceConfig.
56 kbm keys.BuilderMap
57 // Endpoint from the user's original dial target. Used to set the `host_key`
58 // field in `extra_keys`.
59 origEndpoint string
60
61 lb *rlsBalancer
62
63 // The picker is given its own copy of the below fields from the RLS LB policy
64 // to avoid having to grab the mutex on the latter.
65 rlsServerTarget string
66 grpcTarget string
67 metricsRecorder estats.MetricsRecorder
68 defaultPolicy *childPolicyWrapper // Child policy for the default target.
69 ctrlCh *controlChannel // Control channel to the RLS server.
70 maxAge time.Duration // Cache max age from LB config.
71 staleAge time.Duration // Cache stale age from LB config.
72 bg exitIdler
73 logger *internalgrpclog.PrefixLogger
74}
75
76// isFullMethodNameValid return true if name is of the form `/service/method`.
77func isFullMethodNameValid(name string) bool {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected