frankgh commented on code in PR #312:
URL: https://github.com/apache/cassandra-sidecar/pull/312#discussion_r2789793719


##########
server/src/main/java/org/apache/cassandra/sidecar/modules/ConfigurationModule.java:
##########
@@ -240,21 +240,29 @@ private static InstanceMetadata 
buildInstanceMetadata(Vertx vertx,
                                                                          host,
                                                                          port,
                                                                          new 
InstanceHealthMetrics(instanceSpecificRegistry));
-        return InstanceMetadataImpl.builder()
-                                   .id(cassandraInstance.id())
-                                   .host(host, dnsResolver)
-                                   .port(port)
-                                   .storageDir(cassandraInstance.storageDir())
-                                   .dataDirs(cassandraInstance.dataDirs())
-                                   .stagingDir(cassandraInstance.stagingDir())
-                                   .cdcDir(cassandraInstance.cdcDir())
-                                   
.commitlogDir(cassandraInstance.commitlogDir())
-                                   .hintsDir(cassandraInstance.hintsDir())
-                                   
.savedCachesDir(cassandraInstance.savedCachesDir())
-                                   
.localSystemDataFileDir(cassandraInstance.localSystemDataFileDir())
-                                   
.lifecycleOptions(cassandraInstance.lifecycleOptions())
-                                   .delegate(delegate)
-                                   .metricRegistry(instanceSpecificRegistry)
-                                   .build();
+        InstanceMetadataImpl.Builder builder = InstanceMetadataImpl.builder()
+                                                                    
.id(cassandraInstance.id())
+                                                                    
.host(host, dnsResolver)
+                                                                    
.port(port);
+
+        // Only set storagePort if explicitly configured, otherwise use 
builder default
+        Integer configuredStoragePort = cassandraInstance.storagePort();
+        if (configuredStoragePort != null)
+        {
+            builder.storagePort(configuredStoragePort);
+        }

Review Comment:
   is this check still applicable? `configuredStoragePort` should never be null



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to