MINOR: Improve log warning to include the log name
Author: Ismael Juma
Reviewers: Rajini Sivaram
Closes from ijuma/tweak-log-warning
@@ -287,7 +287,7 @@ private[log] object LogCleanerManager extends Logging {
if (offset < logStartOffset) {
// don't bother with the warning if compact and delete are enabled.
if (!isCompactAndDelete(log))
- warn(s"Resetting first dirty offset to log start offset $logStartOffset since the checkpointed offset $offset is invalid.")
+ warn(s"Resetting first dirty offset of ${log.name} to log start offset $logStartOffset since the checkpointed offset $offset is invalid.")
logStartOffset
} else {
offset
@@ -312,12 +312,11 @@ private[log] object LogCleanerManager extends Logging {
// the first segment whose largest message timestamp is within a minimum time lag from now
if (compactionLagMs > 0) {
- dirtyNonActiveSegments.find {
- s =>
+ dirtyNonActiveSegments.find { s =>
val isUncleanable = s.largestTimestamp > now - compactionLagMs
debug(s"Checking if log segment may be cleaned: log='${log.name}' segment.baseOffset=${s.baseOffset} segment.largestTimestamp=${s.largestTimestamp}; now - compactionLag=${now - compactionLagMs}; is uncleanable=$isUncleanable")
isUncleanable
- } map(_.baseOffset)
+ }.map(_.baseOffset)
} else None
).flatten.min
