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

Method getGroupByServer

pkg/topom/context.go:194–203  ·  view source on GitHub ↗
(addr string)

Source from the content-addressed store, hash-verified

192}
193
194func (ctx *context) getGroupByServer(addr string) (*models.Group, int, error) {
195 for _, g := range ctx.group {
196 for i, x := range g.Servers {
197 if x.Addr == addr {
198 return g, i, nil
199 }
200 }
201 }
202 return nil, -1, errors.Errorf("server-[%s] doesn't exist", addr)
203}
204
205func (ctx *context) maxSyncActionIndex() (maxIndex int) {
206 for _, g := range ctx.group {

Callers 5

SyncCreateActionMethod · 0.80
SyncRemoveActionMethod · 0.80
SyncActionPrepareMethod · 0.80
SyncActionCompleteMethod · 0.80
newSyncActionExecutorMethod · 0.80

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected