Maros Orsak created KAFKA-20343:
-----------------------------------
Summary: Refactor makeCleaner test helper overloads in
LogCleanerIntegrationTest to use the builder pattern
Key: KAFKA-20343
URL: https://issues.apache.org/jira/browse/KAFKA-20343
Project: Kafka
Issue Type: Improvement
Reporter: Maros Orsak
LogCleanerIntegrationTest has 6 overloaded makeCleaner methods that all
delegate to a single primary overload with 11 parameters. The 5 convenience
overloads each pick a different subset of parameters and fill in defaults for
the rest. This is hard to read and maintain so adding builder pattern here
would be beneficial both for readability and maintainability.
We should follow the LocalTieredStorageEvent.Builder or
ListOffsetsPartitionStatus.Builder and do the same to LogCleaner.
Note that we need to make some of the fields required and some of the optional
i.e.,
{code:java}
LogCleaner cleaner = LogCleaner.builder(logDirs, logs, logDirFailureChannel)
.backoffMs(15000L)
.minCompactionLagMs(3600000L)
.segmentSize(256)
.time(time)
.build(); {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)