MCPcopy
hub / github.com/CodisLabs/codis / MigrateSlot

Method MigrateSlot

pkg/utils/redis/client.go:208–223  ·  view source on GitHub ↗
(slot int, target string)

Source from the content-addressed store, hash-verified

206}
207
208func (c *Client) MigrateSlot(slot int, target string) (int, error) {
209 host, port, err := net.SplitHostPort(target)
210 if err != nil {
211 return 0, errors.Trace(err)
212 }
213 mseconds := int(c.Timeout / time.Millisecond)
214 if reply, err := c.Do("SLOTSMGRTTAGSLOT", host, port, mseconds, slot); err != nil {
215 return 0, errors.Trace(err)
216 } else {
217 p, err := redigo.Ints(redigo.Values(reply, nil))
218 if err != nil || len(p) != 2 {
219 return 0, errors.Errorf("invalid response = %v", reply)
220 }
221 return p[1], nil
222 }
223}
224
225type MigrateSlotAsyncOption struct {
226 MaxBulks int

Callers 1

newSlotActionExecutorMethod · 0.80

Calls 4

DoMethod · 0.95
IntsMethod · 0.80
ValuesMethod · 0.80
ErrorfMethod · 0.80

Tested by

no test coverage detected