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

Method LoadSlotMapping

pkg/models/store.go:146–156  ·  view source on GitHub ↗
(sid int, must bool)

Source from the content-addressed store, hash-verified

144}
145
146func (s *Store) LoadSlotMapping(sid int, must bool) (*SlotMapping, error) {
147 b, err := s.client.Read(s.SlotPath(sid), must)
148 if err != nil || b == nil {
149 return nil, err
150 }
151 m := &SlotMapping{}
152 if err := jsonDecode(m, b); err != nil {
153 return nil, err
154 }
155 return m, nil
156}
157
158func (s *Store) UpdateSlotMapping(m *SlotMapping) error {
159 return s.client.Update(s.SlotPath(m.Id), m.Encode())

Callers 2

SlotMappingsMethod · 0.95
refillCacheSlotsMethod · 0.80

Calls 3

SlotPathMethod · 0.95
jsonDecodeFunction · 0.85
ReadMethod · 0.65

Tested by

no test coverage detected