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

Function newRevCacheDelta

db/revision_cache_interface.go:395–410  ·  view source on GitHub ↗
(deltaBytes []byte, fromRevID string, toRevision DocumentRevision, deleted bool, toRevAttStorageMeta []AttachmentStorageMeta)

Source from the content-addressed store, hash-verified

393}
394
395func newRevCacheDelta(deltaBytes []byte, fromRevID string, toRevision DocumentRevision, deleted bool, toRevAttStorageMeta []AttachmentStorageMeta) RevisionDelta {
396 revDelta := RevisionDelta{
397 ToRevID: toRevision.RevID,
398 DeltaBytes: deltaBytes,
399 AttachmentStorageMeta: toRevAttStorageMeta,
400 ToChannels: toRevision.Channels,
401 RevisionHistory: toRevision.History.parseAncestorRevisions(fromRevID),
402 HlvHistory: toRevision.HlvHistory,
403 ToDeleted: deleted,
404 }
405 if toRevision.CV != nil {
406 revDelta.ToCV = toRevision.CV.String()
407 }
408 revDelta.CalculateDeltaBytes()
409 return revDelta
410}
411
412// This is the RevisionCacheLoaderFunc callback for the context's RevisionCache.
413// Its job is to load a revision from the bucket when there's a cache miss.

Calls 3

CalculateDeltaBytesMethod · 0.95
StringMethod · 0.65