Would code look a bit more elegant by doing this:
```
inProgress.get(topicPartition) match {
case None =>
inProgress.put(topicPartition, LogCleaningPaused(1))
case Some(LogCleaningInProgress) =>
inProgress.put(topicPartition, LogCleaningAborted)
case Some(LogCleaningPaused(count)) =>
inProgress.put(topicPartition, LogCleaningPaused(count + 1))
case s =>
throw new IllegalStateException(s"Compaction for partition
$topicPartition cannot be aborted and paused since it is in $s state.")
}
```
[ Full content available at: https://github.com/apache/kafka/pull/5694 ]
This message was relayed via gitbox.apache.org for [email protected]