MCPcopy
hub / github.com/grafana/tempo / pollBlocklist

Method pollBlocklist

tempodb/tempodb.go:799–819  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

797}
798
799func (rw *readerWriter) pollBlocklist(ctx context.Context) {
800 blocklist, compactedBlocklist, err := rw.blocklistPoller.Do(ctx, rw.blocklist)
801 if err != nil {
802 if ctx.Err() == nil {
803 level.Error(rw.logger).Log("msg", "failed to poll blocklist", "err", err)
804 }
805
806 return
807 }
808
809 rw.blocklist.ApplyPollResults(blocklist, compactedBlocklist)
810
811 rw.pollerNotificationLock.Lock()
812 defer rw.pollerNotificationLock.Unlock()
813
814 for _, fn := range rw.pollerNotificationFuncs {
815 fn()
816 }
817
818 rw.pollerNotificationFuncs = rw.pollerNotificationFuncs[:0]
819}
820
821// includeBlock indicates whether a given block should be included in a backend search
822func includeBlock(b *backend.BlockMeta, _ common.ID, blockStart, blockEnd []byte, timeStart, timeEnd int64) bool {

Callers 15

EnablePollingMethod · 0.95
PollNowMethod · 0.95
pollingLoopMethod · 0.95
TestDBFunction · 0.80
TestBlockShardingFunction · 0.80
TestBlockCleanupFunction · 0.80
checkBlocklistsFunction · 0.80
TestNoCompactFlagFunction · 0.80
testCompactionRoundtripFunction · 0.80
TestCompactionMetricsFunction · 0.80

Calls 4

ApplyPollResultsMethod · 0.80
DoMethod · 0.65
LogMethod · 0.65
ErrorMethod · 0.65

Tested by 14

TestDBFunction · 0.64
TestBlockShardingFunction · 0.64
TestBlockCleanupFunction · 0.64
checkBlocklistsFunction · 0.64
TestNoCompactFlagFunction · 0.64
testCompactionRoundtripFunction · 0.64
TestCompactionMetricsFunction · 0.64