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

Method RemoveGroup

pkg/topom/topom_group.go:38–56  ·  view source on GitHub ↗
(gid int)

Source from the content-addressed store, hash-verified

36}
37
38func (s *Topom) RemoveGroup(gid int) error {
39 s.mu.Lock()
40 defer s.mu.Unlock()
41 ctx, err := s.newContext()
42 if err != nil {
43 return err
44 }
45
46 g, err := ctx.getGroup(gid)
47 if err != nil {
48 return err
49 }
50 if len(g.Servers) != 0 {
51 return errors.Errorf("group-[%d] isn't empty", gid)
52 }
53 defer s.dirtyGroupCache(g.Id)
54
55 return s.storeRemoveGroup(g)
56}
57
58func (s *Topom) ResyncGroup(gid int) error {
59 s.mu.Lock()

Callers 4

TestGroupRemoveFunction · 0.45
TestGroupDelServerFunction · 0.45
TestApiGroupFunction · 0.45
handleGroupCommandMethod · 0.45

Calls 5

newContextMethod · 0.95
dirtyGroupCacheMethod · 0.95
storeRemoveGroupMethod · 0.95
getGroupMethod · 0.80
ErrorfMethod · 0.80

Tested by 3

TestGroupRemoveFunction · 0.36
TestGroupDelServerFunction · 0.36
TestApiGroupFunction · 0.36