CleanerThread
uses the Cleaner
exclusively for cleaning up a log.
doWork(): Unit
Note
|
doWork is part of the ShutdownableThread Contract to do the work.
|
doWork
simply cleanFilthiestLog.
If there was no dirty log cleaned up, doWork
pauses for the backOffMs (of the CleanerConfig of the parent LogCleaner) (default: 15 seconds).
cleanFilthiestLog(): Boolean
cleanFilthiestLog
requests the LogCleanerManager to grabFilthiestCompactedLog.
If there is any filthiest log to work on, cleanFilthiestLog
cleanLog and turns the cleaned
flag on.
With no logs to work on, cleanFilthiestLog
simply turns the cleaned
flag off.
Note
|
The value of cleaned flag is what cleanFilthiestLog returns.
|
cleanFilthiestLog
requests the LogCleanerManager for the deletable logs and then requests every Log
to deleteOldSegments.
In the end, cleanFilthiestLog
requests the LogCleanerManager to doneDeleting (with the TopicPartitions
of the deletable logs).
In case of an exception, cleanFilthiestLog
…FIXME
Note
|
cleanFilthiestLog is used exclusively when CleanerThread is requested to doWork.
|
cleanLog(cleanable: LogToClean): Unit
cleanLog
requests the Cleaner to clean the given Log (as LogToClean
) followed by recordStats.
In the end, cleanLog
requests the LogCleanerManager to doneCleaning.
Note
|
cleanLog is used exclusively when CleanerThread is requested to cleanFilthiestLog.
|
recordStats(
id: Int,
name: String,
from: Long,
to: Long,
stats: CleanerStats): Unit
recordStats
…FIXME
Note
|
recordStats is used exclusively when CleanerThread is requested to cleanLog.
|