Remove removes the sub-balancer state. Future updates from this sub-balancer, if any, will be ignored.
(id string)
| 130 | // Remove removes the sub-balancer state. Future updates from this sub-balancer, |
| 131 | // if any, will be ignored. |
| 132 | func (wbsa *Aggregator) Remove(id string) { |
| 133 | wbsa.mu.Lock() |
| 134 | defer wbsa.mu.Unlock() |
| 135 | if _, ok := wbsa.idToPickerState[id]; !ok { |
| 136 | return |
| 137 | } |
| 138 | // Setting the state of the deleted sub-balancer to Shutdown will get csEvltr |
| 139 | // to remove the previous state for any aggregated state evaluations. |
| 140 | // transitions to and from connectivity.Shutdown are ignored by csEvltr. |
| 141 | wbsa.csEvltr.RecordTransition(wbsa.idToPickerState[id].stateToAggregate, connectivity.Shutdown) |
| 142 | // Remove id and picker from picker map. This also results in future updates |
| 143 | // for this ID to be ignored. |
| 144 | delete(wbsa.idToPickerState, id) |
| 145 | wbsa.buildAndUpdateLocked() |
| 146 | } |
| 147 | |
| 148 | // UpdateWeight updates the weight for the given id. Note that this doesn't |
| 149 | // trigger an update to the parent ClientConn. The caller should decide when |
no test coverage detected