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

Method dispatchAddr

pkg/proxy/router.go:154–166  ·  view source on GitHub ↗
(r *Request, addr string)

Source from the content-addressed store, hash-verified

152}
153
154func (s *Router) dispatchAddr(r *Request, addr string) bool {
155 s.mu.RLock()
156 defer s.mu.RUnlock()
157 if bc := s.pool.primary.Get(addr).BackendConn(r.Database, r.Seed16(), false); bc != nil {
158 bc.PushBack(r)
159 return true
160 }
161 if bc := s.pool.replica.Get(addr).BackendConn(r.Database, r.Seed16(), false); bc != nil {
162 bc.PushBack(r)
163 return true
164 }
165 return false
166}
167
168func (s *Router) fillSlot(m *models.Slot, switched bool, method forwardMethod) {
169 slot := &s.slots[m.Id]

Callers 3

handleRequestPingMethod · 0.80
handleRequestInfoMethod · 0.80

Calls 4

BackendConnMethod · 0.80
Seed16Method · 0.80
GetMethod · 0.45
PushBackMethod · 0.45

Tested by

no test coverage detected