MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / populateDeleteAll

Method populateDeleteAll

posting/list.go:240–265  ·  view source on GitHub ↗

populateDeleteAll() returns the deleteAllMarker under readTs. It also finds out and sets the global deleteAllMarker in hopes to cache it and use it later if required.

(readTs uint64)

Source from the content-addressed store, hash-verified

238// populateDeleteAll() returns the deleteAllMarker under readTs. It also finds out and sets the global deleteAllMarker
239// in hopes to cache it and use it later if required.
240func (mm *MutableLayer) populateDeleteAll(readTs uint64) uint64 {
241 if mm == nil {
242 return 0
243 }
244 if mm.deleteAllMarker != math.MaxUint64 {
245 if readTs >= mm.deleteAllMarker {
246 return mm.deleteAllMarker
247 }
248 // I need to calculate deleteAllMarker again. I can't use the one from cache
249 }
250 deleteAllMarker := uint64(0)
251 deleteAllMarkerBelowTs := uint64(0)
252 mm.iterateCommittedEntries(func(ts uint64, pl *pb.PostingList) {
253 for _, pl := range pl.Postings {
254 if hasDeleteAll(pl) {
255 deleteAllMarker = x.Max(deleteAllMarker, ts)
256 if ts <= readTs {
257 deleteAllMarkerBelowTs = x.Max(deleteAllMarkerBelowTs, ts)
258 }
259 }
260 }
261 })
262
263 mm.deleteAllMarker = deleteAllMarker
264 return deleteAllMarkerBelowTs
265}
266
267// iterateCommittedEntries is an internal function that's used to calculate delete all marker and iterate. No other
268// function should use this. They should use .iterate() instead.

Callers 6

listLenMethod · 0.95
iterateMethod · 0.95
findPostingMethod · 0.95
TestMutableMapFunction · 0.80
TestListDeleteMarkerFunction · 0.80
GetLengthMethod · 0.80

Calls 3

MaxFunction · 0.92
hasDeleteAllFunction · 0.85

Tested by 2

TestMutableMapFunction · 0.64
TestListDeleteMarkerFunction · 0.64