MCPcopy
hub / github.com/dgraph-io/dgraph / fillPreds

Method fillPreds

posting/lists.go:425–440  ·  view source on GitHub ↗
(ctx *api.TxnContext, gid uint32)

Source from the content-addressed store, hash-verified

423}
424
425func (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}

Callers 1

FillContextMethod · 0.80

Calls 5

ParseFunction · 0.92
CheckFunction · 0.92
UniqueFunction · 0.92
RLockMethod · 0.80
RUnlockMethod · 0.80

Tested by

no test coverage detected