Actually Kafka only support two mutually exclusive log cleanup policy: 1) delete logs after retention period passed. 2) compact the log to only keep the last updated value of a key.
log.retention.hours is only used by (1). For log compaction, currently it is not compacting the logs by its age, but by the dirty ratio in bytes (uncompacted log size / total log size). The config is log.cleaner.min.cleanable.ratio. So it might be a little bit hard to enforce the policy of "compact log after 7 days". Jiangjie (Becket) Qin
