chia7712 commented on code in PR #15885: URL: https://github.com/apache/kafka/pull/15885#discussion_r1598474965
########## storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/TopicBasedRemoteLogMetadataManager.java: ########## @@ -89,14 +90,16 @@ public class TopicBasedRemoteLogMetadataManager implements RemoteLogMetadataMana private volatile RemoteLogMetadataTopicPartitioner rlmTopicPartitioner; private final Set<TopicIdPartition> pendingAssignPartitions = Collections.synchronizedSet(new HashSet<>()); private volatile boolean initializationFailed; + private final Supplier<RemotePartitionMetadataStore> remoteLogMetadataManagerSupplier; public TopicBasedRemoteLogMetadataManager() { Review Comment: Could you add comments to say this default constructor is required as we create `RemoteLogMetadataManager` dynamically? ########## storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/TopicBasedRemoteLogMetadataManager.java: ########## @@ -89,14 +90,16 @@ public class TopicBasedRemoteLogMetadataManager implements RemoteLogMetadataMana private volatile RemoteLogMetadataTopicPartitioner rlmTopicPartitioner; private final Set<TopicIdPartition> pendingAssignPartitions = Collections.synchronizedSet(new HashSet<>()); private volatile boolean initializationFailed; + private final Supplier<RemotePartitionMetadataStore> remoteLogMetadataManagerSupplier; public TopicBasedRemoteLogMetadataManager() { - this(true); + this(true, RemotePartitionMetadataStore::new); } // Visible for testing. - public TopicBasedRemoteLogMetadataManager(boolean startConsumerThread) { + public TopicBasedRemoteLogMetadataManager(boolean startConsumerThread, Supplier<RemotePartitionMetadataStore> remoteLogMetadataManagerSupplier) { Review Comment: It seems `package-private` is enough in testing, right? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org