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)
| 82 | // Note that it also applies any known local changes and then wipes them out to be restored |
| 83 | // in the next polling cycle. |
| 84 | func (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 |