type Periodic … // newPeriodic creates a new instance of Periodic compactor that purges // the log older than h Duration. func newPeriodic(lg *zap.Logger, clock clockwork.Clock, h time.Duration, rg RevGetter, c Compactable) *Periodic { … } // Run runs periodic compactor. func (pc *Periodic) Run() { … } // if given compaction period x is <1-hour, compact every x duration. // (e.g. --auto-compaction-mode 'periodic' --auto-compaction-retention='10m', then compact every 10-minute) // if given compaction period x is >1-hour, compact every hour. // (e.g. --auto-compaction-mode 'periodic' --auto-compaction-retention='2h', then compact every 1-hour) func (pc *Periodic) getCompactInterval() time.Duration { … } func (pc *Periodic) getRetentions() int { … } const retryDivisor … func (pc *Periodic) getRetryInterval() time.Duration { … } // Stop stops periodic compactor. func (pc *Periodic) Stop() { … } // Pause pauses periodic compactor. func (pc *Periodic) Pause() { … } // Resume resumes periodic compactor. func (pc *Periodic) Resume() { … }