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)
| 150 | // setCurrentEntires() sets the posting in currentEntries. It's used to overwrite the currentEntires. It empties the |
| 151 | // currentUids and sets the readTs. |
| 152 | func (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. |