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

Method iterate

posting/list.go:287–300  ·  view source on GitHub ↗

Before iterating, we have to figure out where the last delete marker is Then gather the posts that would be above the marker

(f func(ts uint64, pl *pb.PostingList), readTs uint64)

Source from the content-addressed store, hash-verified

285// Before iterating, we have to figure out where the last delete marker is
286// Then gather the posts that would be above the marker
287func (mm *MutableLayer) iterate(f func(ts uint64, pl *pb.PostingList), readTs uint64) uint64 {
288 if mm == nil {
289 return 0
290 }
291
292 deleteAllMarker := mm.populateDeleteAll(readTs)
293 mm.iterateCommittedEntries(func(ts uint64, pl *pb.PostingList) {
294 // Note this might not be required, but just here for safety
295 if ts >= deleteAllMarker && ts <= readTs {
296 f(ts, pl)
297 }
298 })
299 return deleteAllMarker
300}
301
302// insertCommittedPostings inserts an old committed posting in the mutable layer. It also updates fields that are
303// cached. This includes deleteAllMarker, length and committedUids map. this should be called while

Callers 2

listLenMethod · 0.95
findPostingMethod · 0.95

Calls 2

populateDeleteAllMethod · 0.95

Tested by

no test coverage detected