func (mh *MossHerder) OnPersisterProgress(c moss.Collection) { if c.Options().LowerLevelUpdate == nil { return } mh.m.Lock() if mh.waiting > 0 { log.Printf("moss_herder: persistence progess, waiting: %d", mh.waiting) } mh.waitCond.Broadcast() mh.m.Unlock() }
func (mh *MossHerder) OnBatchExecuteStart(c moss.Collection) { if c.Options().LowerLevelUpdate == nil { return } mh.m.Lock() mh.collections[c] = struct{}{} for mh.overMemQuotaLOCKED() { // If we're over the memory quota, then wait for persister progress. mh.waiting++ mh.waitCond.Wait() mh.waiting-- } mh.m.Unlock() }