Yunyung commented on code in PR #19286: URL: https://github.com/apache/kafka/pull/19286#discussion_r2026783253
########## core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java: ########## @@ -3741,6 +3735,34 @@ long findLogStartOffset(TopicIdPartition topicIdPartition, UnifiedLog log) { verifyNoMoreInteractions(remoteStorageManager); } + @Test + public void testMonitorableRemoteLogStorageManager() throws IOException { + Properties props = new Properties(); + props.putAll(brokerConfig); + appendRLMConfig(props); + props.put(RemoteLogManagerConfig.REMOTE_STORAGE_MANAGER_CLASS_NAME_PROP, MonitorableNoOpRemoteStorageManager.class.getName()); + props.put(RemoteLogManagerConfig.REMOTE_LOG_METADATA_MANAGER_CLASS_NAME_PROP, MonitorableNoOpRemoteLogMetadataManager.class.getName()); + KafkaConfig config = KafkaConfig.fromProps(props); + try (RemoteLogManager remoteLogManager = new RemoteLogManager( + config.remoteLogManagerConfig(), + brokerId, + logDir, + clusterId, + time, + tp -> Optional.of(mockLog), + (topicPartition, offset) -> { }, + brokerTopicStats, + metrics, + endPoint)) { + assertInstanceOf(MonitorableNoOpRemoteStorageManager.class, remoteLogManager.storageManager()); + assertInstanceOf(MonitorableNoOpRemoteLogMetadataManager.class, remoteLogManager.remoteLogMetadataManager()); + + // We need to call startup for call config() and call withPluginMetrics() Review Comment: This code comment is outdated. ########## core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java: ########## @@ -3785,4 +3807,20 @@ private void appendRLMConfig(Properties props) { props.put(DEFAULT_REMOTE_LOG_METADATA_MANAGER_CONFIG_PREFIX + remoteLogMetadataProducerTestProp, remoteLogMetadataProducerTestVal); } + public static class MonitorableNoOpRemoteStorageManager extends NoOpRemoteStorageManager implements Monitorable { + public boolean pluginMetrics = false; + + @Override + public void withPluginMetrics(PluginMetrics metrics) { + pluginMetrics = true; + } + } + + public static class MonitorableNoOpRemoteLogMetadataManager extends NoOpRemoteLogMetadataManager implements Monitorable { + public boolean pluginMetrics = false; + @Override Review Comment: add a space above. -- 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