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

Method getSlotMapping

pkg/topom/context.go:34–42  ·  view source on GitHub ↗
(sid int)

Source from the content-addressed store, hash-verified

32}
33
34func (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
44func (ctx *context) getSlotMappingsByGroupId(gid int) []*models.SlotMapping {
45 var slots = []*models.SlotMapping{}

Callers 11

TestSlotStateFunction · 0.80
getSlotMappingFunction · 0.80
SlotCreateActionMethod · 0.80
SlotCreateActionSomeMethod · 0.80
SlotCreateActionRangeMethod · 0.80
SlotRemoveActionMethod · 0.80
SlotActionCompleteMethod · 0.80
newSlotActionExecutorMethod · 0.80
SlotsAssignGroupMethod · 0.80
SlotsAssignOfflineMethod · 0.80
SlotsRebalanceMethod · 0.80

Calls 1

ErrorfMethod · 0.80

Tested by 2

TestSlotStateFunction · 0.64
getSlotMappingFunction · 0.64