TaiJuWu commented on code in PR #19286:
URL: https://github.com/apache/kafka/pull/19286#discussion_r2043673355


##########
core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java:
##########
@@ -3741,6 +3737,33 @@ 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());
+
+            assertEquals(true, ((MonitorableNoOpRemoteStorageManager) 
remoteLogManager.storageManager()).pluginMetrics);
+            assertEquals(true, ((MonitorableNoOpRemoteLogMetadataManager) 
remoteLogManager.remoteLogMetadataManager()).pluginMetrics);

Review Comment:
   Done.



-- 
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

Reply via email to