| 423 | } |
| 424 | |
| 425 | func (lc *LocalCache) fillPreds(ctx *api.TxnContext, gid uint32) { |
| 426 | lc.RLock() |
| 427 | defer lc.RUnlock() |
| 428 | for key := range lc.deltas { |
| 429 | pk, err := x.Parse([]byte(key)) |
| 430 | x.Check(err) |
| 431 | if len(pk.Attr) == 0 { |
| 432 | continue |
| 433 | } |
| 434 | // Also send the group id that the predicate was being served by. This is useful when |
| 435 | // checking if Zero should allow a commit during a predicate move. |
| 436 | predKey := fmt.Sprintf("%d-%s", gid, pk.Attr) |
| 437 | ctx.Preds = append(ctx.Preds, predKey) |
| 438 | } |
| 439 | ctx.Preds = x.Unique(ctx.Preds) |
| 440 | } |