(sid int)
| 32 | } |
| 33 | |
| 34 | func (ctx *context) getSlotMapping(sid int) (*models.SlotMapping, error) { |
| 35 | if len(ctx.slots) != MaxSlotNum { |
| 36 | return nil, errors.Errorf("invalid number of slots = %d/%d", len(ctx.slots), MaxSlotNum) |
| 37 | } |
| 38 | if sid >= 0 && sid < MaxSlotNum { |
| 39 | return ctx.slots[sid], nil |
| 40 | } |
| 41 | return nil, errors.Errorf("slot-[%d] doesn't exist", sid) |
| 42 | } |
| 43 | |
| 44 | func (ctx *context) getSlotMappingsByGroupId(gid int) []*models.SlotMapping { |
| 45 | var slots = []*models.SlotMapping{} |