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

Method setCurrentEntries

posting/list.go:152–168  ·  view source on GitHub ↗

setCurrentEntires() sets the posting in currentEntries. It's used to overwrite the currentEntires. It empties the currentUids and sets the readTs.

(ts uint64, pl *pb.PostingList)

Source from the content-addressed store, hash-verified

150// setCurrentEntires() sets the posting in currentEntries. It's used to overwrite the currentEntires. It empties the
151// currentUids and sets the readTs.
152func (mm *MutableLayer) setCurrentEntries(ts uint64, pl *pb.PostingList) {
153 if mm == nil {
154 x.AssertTrue(false)
155 return
156 }
157 if mm.readTs != 0 {
158 x.AssertTruef(mm.readTs == ts, "List object reused for a different transaction %d %d", mm.readTs, ts)
159 }
160
161 mm.readTs = ts
162 mm.currentEntries = pl
163 clear(mm.currentUids)
164 mm.isUidsCalculated = false
165 mm.calculatedUids = nil
166 mm.deleteAllMarker = math.MaxUint64
167 mm.populateUidMap(pl)
168}
169
170// get() returns the posting stored in the mutable layer at any given timestamp. If the ts is the same as readTs,
171// we will return the currentEntries, otherwise it should be the commitTs of old postings.

Callers 4

TestMutableMapFunction · 0.80
GetScalarListMethod · 0.80
updateMutationLayerMethod · 0.80
setMutationMethod · 0.80

Calls 3

populateUidMapMethod · 0.95
AssertTrueFunction · 0.92
AssertTruefFunction · 0.92

Tested by 1

TestMutableMapFunction · 0.64