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

Method MigrateSlotAsync

pkg/utils/redis/client.go:232–247  ·  view source on GitHub ↗
(slot int, target string, option *MigrateSlotAsyncOption)

Source from the content-addressed store, hash-verified

230}
231
232func (c *Client) MigrateSlotAsync(slot int, target string, option *MigrateSlotAsyncOption) (int, error) {
233 host, port, err := net.SplitHostPort(target)
234 if err != nil {
235 return 0, errors.Trace(err)
236 }
237 if reply, err := c.Do("SLOTSMGRTTAGSLOT-ASYNC", host, port, int(option.Timeout/time.Millisecond),
238 option.MaxBulks, option.MaxBytes, slot, option.NumKeys); err != nil {
239 return 0, errors.Trace(err)
240 } else {
241 p, err := redigo.Ints(redigo.Values(reply, nil))
242 if err != nil || len(p) != 2 {
243 return 0, errors.Errorf("invalid response = %v", reply)
244 }
245 return p[1], nil
246 }
247}
248
249func (c *Client) SlotsInfo() (map[int]int, error) {
250 if reply, err := c.Do("SLOTSINFO"); err != nil {

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