LogCleanerManager
LogCleanerManager is created exclusively for LogCleaner.
LogCleanerManager is a KafkaMetricsGroup and registers performance metrics.
| Metric Name | Description |
|---|---|
|
|
|
|
|
(for every log directory) |
|
(for every log directory) |
The performance metrics are registered in kafka.log:type=LogCleanerManager group.
LogCleanerManager uses cleaner-offset-checkpoint for the name of the offset checkpoint files for every log directory (in checkpoints registry).
| Name | Description |
|---|---|
|
Used in updateCheckpoints, maybeTruncateCheckpoint, and alterCheckpointDir to look up the Used in allCleanerCheckpoints to access all Used in handleLogDirFailure to exclude a failed log directory from cleaning |
LogCleanerManager uses kafka.log.LogCleaner logger.
|
Tip
|
Enable |
Creating LogCleanerManager Instance
LogCleanerManager takes the following to be created:
-
Logs per Kafka
TopicPartition
LogCleanerManager initializes the internal registries and counters.
isCompactAndDelete Utility
isCompactAndDelete(log: Log): Boolean
isCompactAndDelete flag is enabled (true) when compact and delete cleanup policies are both included in the cleanup.policy configuration property. Otherwise, isCompactAndDelete flag is disabled (false).
|
Note
|
isCompactAndDelete is used when…FIXME
|
cleanableOffsets Method
cleanableOffsets(
log: Log,
topicPartition: TopicPartition,
lastClean: immutable.Map[TopicPartition, Long],
now: Long): (Long, Long)
cleanableOffsets…FIXME
|
Note
|
cleanableOffsets is used when…FIXME
|
grabFilthiestCompactedLog Method
grabFilthiestCompactedLog(time: Time): Option[LogToClean]
grabFilthiestCompactedLog…FIXME
|
Note
|
grabFilthiestCompactedLog is used when…FIXME
|
deletableLogs Method
deletableLogs(): Iterable[(TopicPartition, Log)]
deletableLogs…FIXME
|
Note
|
deletableLogs is used when…FIXME
|
doneDeleting Method
doneDeleting(topicPartitions: Iterable[TopicPartition]): Unit
doneDeleting…FIXME
|
Note
|
doneDeleting is used when…FIXME
|
doneCleaning Method
doneCleaning(
topicPartition: TopicPartition,
dataDir: File,
endOffset: Long): Unit
doneCleaning…FIXME
|
Note
|
doneCleaning is used exclusively when CleanerThread is requested to cleanLog.
|
allCleanerCheckpoints Method
allCleanerCheckpoints: Map[TopicPartition, Long]
allCleanerCheckpoints…FIXME
|
Note
|
|
alterCheckpointDir Method
alterCheckpointDir(
topicPartition: TopicPartition,
sourceLogDir: File,
destLogDir: File): Unit
alterCheckpointDir…FIXME
|
Note
|
alterCheckpointDir is used exclusively when LogCleaner is requested to alterCheckpointDir.
|
handleLogDirFailure Method
handleLogDirFailure(dir: String): Unit
handleLogDirFailure…FIXME
|
Note
|
handleLogDirFailure is used exclusively when LogCleaner is requested to handleLogDirFailure.
|
updateCheckpoints Method
updateCheckpoints(
dataDir: File,
update: Option[(TopicPartition, Long)]): Unit
updateCheckpoints…FIXME
|
Note
|
|
maybeTruncateCheckpoint Method
maybeTruncateCheckpoint(dataDir: File, topicPartition: TopicPartition, offset: Long): Unit
maybeTruncateCheckpoint…FIXME
|
Note
|
maybeTruncateCheckpoint is used exclusively when LogCleaner is requested to maybeTruncateCheckpoint.
|