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

Method handleRequestSlotsScan

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

Source from the content-addressed store, hash-verified

565}
566
567func (s *Session) handleRequestSlotsScan(r *Request, d *Router) error {
568 var nblks = len(r.Multi) - 1
569 switch {
570 case nblks <= 1:
571 r.Resp = redis.NewErrorf("ERR wrong number of arguments for 'SLOTSSCAN' command")
572 return nil
573 }
574 switch slot, err := redis.Btoi64(r.Multi[1].Value); {
575 case err != nil:
576 r.Resp = redis.NewErrorf("ERR parse slotnum '%s' failed, %s", r.Multi[1].Value, err)
577 return nil
578 case slot < 0 || slot >= MaxSlotNum:
579 r.Resp = redis.NewErrorf("ERR parse slotnum '%s' failed, out of range", r.Multi[1].Value)
580 return nil
581 default:
582 return d.dispatchSlot(r, int(slot))
583 }
584}
585
586func (s *Session) handleRequestSlotsMapping(r *Request, d *Router) error {
587 var nblks = len(r.Multi) - 1

Callers 1

handleRequestMethod · 0.95

Calls 1

dispatchSlotMethod · 0.80

Tested by

no test coverage detected