MCPcopy Index your code
hub / github.com/CodisLabs/codis / SwitchMasters

Method SwitchMasters

pkg/proxy/router.go:235–248  ·  view source on GitHub ↗
(masters map[int]string)

Source from the content-addressed store, hash-verified

233}
234
235func (s *Router) SwitchMasters(masters map[int]string) error {
236 s.mu.Lock()
237 defer s.mu.Unlock()
238 if s.closed {
239 return ErrClosedRouter
240 }
241 cache := &redis.InfoCache{
242 Auth: s.config.ProductAuth, Timeout: time.Millisecond * 100,
243 }
244 for i := range s.slots {
245 s.trySwitchMaster(i, masters, cache)
246 }
247 return nil
248}
249
250func (s *Router) trySwitchMaster(id int, masters map[int]string, cache *redis.InfoCache) {
251 var switched bool

Callers

nothing calls this directly

Calls 1

trySwitchMasterMethod · 0.95

Tested by

no test coverage detected