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

Method isGroupLocked

pkg/topom/context.go:267–283  ·  view source on GitHub ↗
(gid int)

Source from the content-addressed store, hash-verified

265}
266
267func (ctx *context) isGroupLocked(gid int) bool {
268 if g := ctx.group[gid]; g != nil {
269 switch g.Promoting.State {
270 case models.ActionNothing:
271 return false
272 case models.ActionPreparing:
273 return false
274 case models.ActionPrepared:
275 return true
276 case models.ActionFinished:
277 return false
278 default:
279 log.Panicf("invalid state of group-[%d] = %s", g.Id, g.Encode())
280 }
281 }
282 return false
283}
284
285func (ctx *context) isGroupPromoting(gid int) bool {
286 if g := ctx.group[gid]; g != nil {

Callers 1

isSlotLockedMethod · 0.95

Calls 2

PanicfMethod · 0.80
EncodeMethod · 0.45

Tested by

no test coverage detected