Attempt to update the delta on a revision cache entry. If the entry is no longer resident in the cache, fails silently
(ctx context.Context, docID, revID string, collectionID uint32, toDelta RevisionDelta)
| 181 | // Attempt to update the delta on a revision cache entry. If the entry is no longer resident in the cache, |
| 182 | // fails silently |
| 183 | func (rc *LRURevisionCache) UpdateDelta(ctx context.Context, docID, revID string, collectionID uint32, toDelta RevisionDelta) { |
| 184 | value := rc.getValue(ctx, docID, revID, collectionID, false) |
| 185 | if value != nil { |
| 186 | outGoingBytes := value.updateDelta(toDelta) |
| 187 | if outGoingBytes != 0 { |
| 188 | rc.currMemoryUsage.Add(outGoingBytes) |
| 189 | rc.cacheMemoryBytesStat.Add(outGoingBytes) |
| 190 | } |
| 191 | // check for memory based eviction |
| 192 | rc.revCacheMemoryBasedEviction(ctx) |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | func (rc *LRURevisionCache) UpdateDeltaCV(ctx context.Context, docID string, cv *Version, collectionID uint32, toDelta RevisionDelta) { |
| 197 | value := rc.getValueByCV(ctx, docID, cv, collectionID, false) |