func (e *Edge) CollectMaps(m *MapResult) error { if wlog.LogLevel() == wlog.DEBUG { // Explicitly check log level since this is expensive and frequent e.logger.Printf( "D! collect maps c: %s e: %s\n", e.statMap.Get(statCollected), e.statMap.Get(statEmitted), ) } e.statMap.Add(statCollected, 1) select { case <-e.aborted: return ErrAborted case e.reduce <- m: return nil } }
func (e *Edge) CollectBatch(b models.Batch) error { if wlog.LogLevel() == wlog.DEBUG { // Explicitly check log level since this is expensive and frequent e.logger.Printf( "D! collect batch c: %s e: %s\n", e.statMap.Get(statCollected), e.statMap.Get(statEmitted), ) } e.statMap.Add(statCollected, 1) select { case <-e.aborted: return ErrAborted case e.batch <- b: return nil } }
func (e *Edge) NextMaps() (m *MapResult, ok bool) { if wlog.LogLevel() == wlog.DEBUG { // Explicitly check log level since this is expensive and frequent e.logger.Printf( "D! next maps c: %s e: %s\n", e.statMap.Get(statCollected), e.statMap.Get(statEmitted), ) } select { case <-e.aborted: case m, ok = <-e.reduce: if ok { e.statMap.Add(statEmitted, 1) } } return }
func (e *Edge) NextBatch() (b models.Batch, ok bool) { if wlog.LogLevel() == wlog.DEBUG { // Explicitly check log level since this is expensive and frequent e.logger.Printf( "D! next batch c: %s e: %s\n", e.statMap.Get(statCollected), e.statMap.Get(statEmitted), ) } select { case <-e.aborted: case b, ok = <-e.batch: if ok { e.statMap.Add(statEmitted, 1) } } return }