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

Method Peek

db/revision_cache_lru.go:173–179  ·  view source on GitHub ↗

Looks up a revision from the cache only. Will not fall back to loader function if not present in the cache.

(ctx context.Context, docID, revID string, collectionID uint32)

Source from the content-addressed store, hash-verified

171// Looks up a revision from the cache only. Will not fall back to loader function if not
172// present in the cache.
173func (rc *LRURevisionCache) Peek(ctx context.Context, docID, revID string, collectionID uint32) (docRev DocumentRevision, found bool) {
174 docRev, err := rc.getFromCacheByRev(ctx, docID, revID, collectionID, false, RevCacheOmitDelta)
175 if err != nil {
176 return DocumentRevision{}, false
177 }
178 return docRev, docRev.BodyBytes != nil
179}
180
181// Attempt to update the delta on a revision cache entry. If the entry is no longer resident in the cache,
182// fails silently

Callers 3

TestRevCacheCapacityStatFunction · 0.95

Calls 1

getFromCacheByRevMethod · 0.95

Tested by 3

TestRevCacheCapacityStatFunction · 0.76