MCPcopy
hub / github.com/lindb/lindb / garbageCollect

Method garbageCollect

replica/channel_database.go:111–123  ·  view source on GitHub ↗

garbageCollect recycles write families which is expired.

()

Source from the content-addressed store, hash-verified

109
110// garbageCollect recycles write families which is expired.
111func (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
126func (dc *databaseChannel) Write(ctx context.Context, brokerBatchRows *metric.BrokerBatchRows) error {

Callers

nothing calls this directly

Calls 4

LockMethod · 0.65
UnlockMethod · 0.65
LoadMethod · 0.65
garbageCollectMethod · 0.65

Tested by

no test coverage detected