garbageCollect recycles write families which is expired.
()
| 109 | |
| 110 | // garbageCollect recycles write families which is expired. |
| 111 | func (dc *databaseChannel) garbageCollect() { |
| 112 | dc.shardChannels.mu.Lock() |
| 113 | defer func() { |
| 114 | dc.shardChannels.mu.Unlock() |
| 115 | }() |
| 116 | |
| 117 | channels := dc.shardChannels.value.Load().(shard2Channel) |
| 118 | ahead := dc.ahead.Load() |
| 119 | behind := dc.behind.Load() |
| 120 | for _, channel := range channels { |
| 121 | channel.garbageCollect(ahead, behind) |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | // Write writes the metric data into shardChannel's buffer |
| 126 | func (dc *databaseChannel) Write(ctx context.Context, brokerBatchRows *metric.BrokerBatchRows) error { |
nothing calls this directly
no test coverage detected