MCPcopy
hub / github.com/lindb/lindb / Run

Method Run

kv/compact_job.go:66–85  ·  view source on GitHub ↗

Run runs compact job

()

Source from the content-addressed store, hash-verified

64
65// Run runs compact job
66func (c *compactJob) Run() error {
67 startTime := time.Now()
68 metrics.CompactStatistics.Compacting.WithTagValues(c.compactType).Incr()
69 defer func() {
70 metrics.CompactStatistics.Compacting.WithTagValues(c.compactType).Decr()
71 metrics.CompactStatistics.Duration.WithTagValues(c.compactType).UpdateSince(startTime)
72 }()
73 compaction := c.state.compaction
74 switch {
75 case c.rollup == nil && compaction.IsTrivialMove():
76 // compact job can move file
77 c.moveCompaction()
78 default:
79 if err := c.mergeCompaction(); err != nil {
80 metrics.CompactStatistics.Failure.WithTagValues(c.compactType).Incr()
81 return err
82 }
83 }
84 return nil
85}
86
87// moveCompaction moves low level file to up level, just does metadata change
88func (c *compactJob) moveCompaction() {

Callers

nothing calls this directly

Calls 7

moveCompactionMethod · 0.95
mergeCompactionMethod · 0.95
UpdateSinceMethod · 0.80
IsTrivialMoveMethod · 0.80
IncrMethod · 0.45
WithTagValuesMethod · 0.45
DecrMethod · 0.45

Tested by

no test coverage detected