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

Method process

pkg/proxy/forward.go:46–62  ·  view source on GitHub ↗
(s *Slot, r *Request, hkey []byte)

Source from the content-addressed store, hash-verified

44}
45
46func (d *forwardSync) process(s *Slot, r *Request, hkey []byte) (*BackendConn, error) {
47 if s.backend.bc == nil {
48 log.Debugf("slot-%04d is not ready: hash key = '%s'",
49 s.id, hkey)
50 return nil, ErrSlotIsNotReady
51 }
52 if s.migrate.bc != nil && len(hkey) != 0 {
53 if err := d.slotsmgrt(s, hkey, r.Database, r.Seed16()); err != nil {
54 log.Debugf("slot-%04d migrate from = %s to %s failed: hash key = '%s', database = %d, error = %s",
55 s.id, s.migrate.bc.Addr(), s.backend.bc.Addr(), hkey, r.Database, err)
56 return nil, err
57 }
58 }
59 r.Group = &s.refs
60 r.Group.Add(1)
61 return d.forward2(s, r), nil
62}
63
64type forwardSemiAsync struct {
65 forwardHelper

Callers 1

ForwardMethod · 0.95

Calls 6

DebugfMethod · 0.80
slotsmgrtMethod · 0.80
Seed16Method · 0.80
forward2Method · 0.80
AddrMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected