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

Method SlotMappings

pkg/models/store.go:130–144  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128}
129
130func (s *Store) SlotMappings() ([]*SlotMapping, error) {
131 slots := make([]*SlotMapping, MaxSlotNum)
132 for i := range slots {
133 m, err := s.LoadSlotMapping(i, false)
134 if err != nil {
135 return nil, err
136 }
137 if m != nil {
138 slots[i] = m
139 } else {
140 slots[i] = &SlotMapping{Id: i}
141 }
142 }
143 return slots, nil
144}
145
146func (s *Store) LoadSlotMapping(sid int, must bool) (*SlotMapping, error) {
147 b, err := s.client.Read(s.SlotPath(sid), must)

Callers 2

refillCacheSlotsMethod · 0.80
dumpConfigV3Method · 0.80

Calls 1

LoadSlotMappingMethod · 0.95

Tested by

no test coverage detected