newChildPolicyWrapper creates a child policy wrapper for the given target, and is initialized with one reference and starts off in CONNECTING state.
(target string)
| 72 | // newChildPolicyWrapper creates a child policy wrapper for the given target, |
| 73 | // and is initialized with one reference and starts off in CONNECTING state. |
| 74 | func newChildPolicyWrapper(target string) *childPolicyWrapper { |
| 75 | c := &childPolicyWrapper{ |
| 76 | target: target, |
| 77 | refCnt: 1, |
| 78 | state: unsafe.Pointer(&balancer.State{ |
| 79 | ConnectivityState: connectivity.Connecting, |
| 80 | Picker: base.NewErrPicker(balancer.ErrNoSubConnAvailable), |
| 81 | }), |
| 82 | } |
| 83 | c.logger = internalgrpclog.NewPrefixLogger(logger, fmt.Sprintf("[rls-child-policy-wrapper %s %p] ", c.target, c)) |
| 84 | c.logger.Infof("Created") |
| 85 | return c |
| 86 | } |
| 87 | |
| 88 | // acquireRef increments the reference count on the child policy wrapper. |
| 89 | func (c *childPolicyWrapper) acquireRef() { |
no test coverage detected