(slot int, target string, option *MigrateSlotAsyncOption)
| 230 | } |
| 231 | |
| 232 | func (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 | |
| 249 | func (c *Client) SlotsInfo() (map[int]int, error) { |
| 250 | if reply, err := c.Do("SLOTSINFO"); err != nil { |
no test coverage detected