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

Method ApplyPollResults

tempodb/blocklist/list.go:84–100  ·  view source on GitHub ↗

ApplyPollResults applies the PerTenant and PerTenantCompacted maps to this blocklist Note that it also applies any known local changes and then wipes them out to be restored in the next polling cycle.

(m PerTenant, c PerTenantCompacted)

Source from the content-addressed store, hash-verified

82// Note that it also applies any known local changes and then wipes them out to be restored
83// in the next polling cycle.
84func (l *List) ApplyPollResults(m PerTenant, c PerTenantCompacted) {
85 l.mtx.Lock()
86 defer l.mtx.Unlock()
87
88 l.metas = m
89 l.compactedMetas = c
90
91 // now reapply all updates and clear
92 for tenantID := range l.added {
93 l.updateInternal(tenantID, l.added[tenantID], l.removed[tenantID], l.compactedAdded[tenantID], l.compactedRemoved[tenantID])
94 }
95
96 clear(l.added)
97 clear(l.removed)
98 clear(l.compactedAdded)
99 clear(l.compactedRemoved)
100}
101
102// Update Adds and removes regular or compacted blocks from the in-memory blocklist.
103// Changes are temporary and will be preserved only for one poll

Callers 7

pollBlocklistMethod · 0.80
testSameIDCompactionFunction · 0.80
TestApplyPollResultsFunction · 0.80
TestUpdatesSavedFunction · 0.80
BenchmarkFullPollerFunction · 0.80
newBlocklistFunction · 0.80
TestPollerOwnershipFunction · 0.80

Calls 1

updateInternalMethod · 0.95

Tested by 6

testSameIDCompactionFunction · 0.64
TestApplyPollResultsFunction · 0.64
TestUpdatesSavedFunction · 0.64
BenchmarkFullPollerFunction · 0.64
newBlocklistFunction · 0.64
TestPollerOwnershipFunction · 0.64