You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Nilesh Kumar (Jira)" <ji...@apache.org> on 2026/03/21 00:54:00 UTC
[jira] [Commented] (KAFKA-20343) Refactor makeCleaner test helper overloads in LogCleanerIntegrationTest to use the builder pattern
[ https://issues.apache.org/jira/browse/KAFKA-20343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18067207#comment-18067207 ]
Nilesh Kumar commented on KAFKA-20343:
--------------------------------------
[https://github.com/apache/kafka/pull/21843]
> 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
> Assignee: Nilesh Kumar
> Priority: Major
>
> 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)