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

Method StartChangeCache

db/util_testing.go:85–106  ·  view source on GitHub ↗

StartChangeCache is called from the cache benchmarking tool to init the change cache, not to be called from outside test code

(t *testing.T, ctx context.Context)

Source from the content-addressed store, hash-verified

83// StartChangeCache is called from the cache benchmarking tool to init the change cache, not to be called
84// from outside test code
85func (db *DatabaseContext) StartChangeCache(t *testing.T, ctx context.Context) {
86 notifyChange := func(ctx context.Context, changedChannels channels.Set) {
87 db.mutationListener.Notify(ctx, changedChannels)
88 }
89
90 // Initialize the change cache
91 if err := db.changeCache.Init(
92 ctx,
93 db,
94 db.channelCache,
95 notifyChange,
96 db.Options.CacheOptions,
97 db.MetadataKeys,
98 ); err != nil {
99 t.Fatal(err)
100 }
101 db.mutationListener.OnChangeCallback = db.changeCache.DocChanged
102 db.changeCache.lock.Unlock()
103
104 // start broadcast goroutine
105 db.mutationListener.StartNotifierBroadcaster(ctx)
106}
107
108// CallProcessEntry allows the cache benchmarking tool to call directly into processEntry, not to
109// be used from outside test code

Callers 1

mainFunction · 0.95

Calls 4

NotifyMethod · 0.80
InitMethod · 0.65
UnlockMethod · 0.45

Tested by

no test coverage detected