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

Function verifyCacheSequences

db/change_cache_test.go:1209–1229  ·  view source on GitHub ↗
(singleCache SingleChannelCache, sequences []uint64)

Source from the content-addressed store, hash-verified

1207}
1208
1209func verifyCacheSequences(singleCache SingleChannelCache, sequences []uint64) bool {
1210
1211 cache, ok := singleCache.(*singleChannelCacheImpl)
1212 if !ok {
1213 return false
1214 }
1215 if len(cache.logs) != len(sequences) {
1216
1217 log.Printf("verifyCacheSequences: cache size (%v) not equals to sequences size (%v)",
1218 len(cache.logs), len(sequences))
1219 return false
1220 }
1221 for index, seq := range sequences {
1222 if cache.logs[index].Sequence != seq {
1223 log.Printf("verifyCacheSequences: sequence mismatch at index %v, cache=%v, sequences=%v",
1224 index, cache.logs[index].Sequence, seq)
1225 return false
1226 }
1227 }
1228 return true
1229}
1230
1231// verifyChangesFullSequences compares for a full match on sequence, including compound elements)
1232func verifyChangesFullSequences(changes []*ChangeEntry, sequences []string) bool {

Callers 1

TestChannelCacheBackfillFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected