MCPcopy Create free account
hub / github.com/couchbaselabs/cbgb / MutationLogger

Function MutationLogger

tap.go:237–254  ·  view source on GitHub ↗
(ch chan interface{})

Source from the content-addressed store, hash-verified

235}
236
237func MutationLogger(ch chan interface{}) {
238 for i := range ch {
239 switch o := i.(type) {
240 case mutation:
241 log.Printf("mutation: %v", o)
242 case vbucketChange:
243 log.Printf("partition change: %v", o)
244 if o.newState == VBActive {
245 if vb := o.getVBucket(); vb != nil {
246 // Watch state changes
247 vb.observer.Register(ch)
248 }
249 }
250 default:
251 panic(fmt.Sprintf("Unhandled item to log %T: %v", i, i))
252 }
253 }
254}

Callers 3

TestMutationLoggerFunction · 0.85
TestMutationInvalidFunction · 0.85
mainFunction · 0.85

Calls 2

getVBucketMethod · 0.80
RegisterMethod · 0.80

Tested by 2

TestMutationLoggerFunction · 0.68
TestMutationInvalidFunction · 0.68