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

Method handleRequestInfo

pkg/proxy/session.go:368–385  ·  view source on GitHub ↗
(r *Request, d *Router)

Source from the content-addressed store, hash-verified

366}
367
368func (s *Session) handleRequestInfo(r *Request, d *Router) error {
369 var addr string
370 var nblks = len(r.Multi) - 1
371 switch {
372 case nblks == 0:
373 slot := uint32(time.Now().Nanosecond()) % MaxSlotNum
374 return d.dispatchSlot(r, int(slot))
375 default:
376 addr = string(r.Multi[1].Value)
377 copy(r.Multi[1:], r.Multi[2:])
378 r.Multi = r.Multi[:nblks]
379 }
380 if !d.dispatchAddr(r, addr) {
381 r.Resp = redis.NewErrorf("ERR backend server '%s' not found", addr)
382 return nil
383 }
384 return nil
385}
386
387func (s *Session) handleRequestMGet(r *Request, d *Router) error {
388 var nkeys = len(r.Multi) - 1

Callers 1

handleRequestMethod · 0.95

Calls 2

dispatchSlotMethod · 0.80
dispatchAddrMethod · 0.80

Tested by

no test coverage detected