MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / UpdateDeltaCV

Method UpdateDeltaCV

db/revision_cache_lru.go:196–207  ·  view source on GitHub ↗
(ctx context.Context, docID string, cv *Version, collectionID uint32, toDelta RevisionDelta)

Source from the content-addressed store, hash-verified

194}
195
196func (rc *LRURevisionCache) UpdateDeltaCV(ctx context.Context, docID string, cv *Version, collectionID uint32, toDelta RevisionDelta) {
197 value := rc.getValueByCV(ctx, docID, cv, collectionID, false)
198 if value != nil {
199 outGoingBytes := value.updateDelta(toDelta)
200 if outGoingBytes != 0 {
201 rc.currMemoryUsage.Add(outGoingBytes)
202 rc.cacheMemoryBytesStat.Add(outGoingBytes)
203 }
204 // check for memory based eviction
205 rc.revCacheMemoryBasedEviction(ctx)
206 }
207}
208
209func (rc *LRURevisionCache) getFromCacheByRev(ctx context.Context, docID, revID string, collectionID uint32, loadOnCacheMiss, includeDelta bool) (DocumentRevision, error) {
210 value := rc.getValue(ctx, docID, revID, collectionID, loadOnCacheMiss)

Callers

nothing calls this directly

Calls 4

getValueByCVMethod · 0.95
updateDeltaMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected