beobal commented on code in PR #4282:
URL: https://github.com/apache/cassandra/pull/4282#discussion_r2262707098


##########
src/java/org/apache/cassandra/cql3/statements/schema/CreateKeyspaceStatement.java:
##########
@@ -82,6 +82,13 @@ public Keyspaces apply(ClusterMetadata metadata)
         }
 
         KeyspaceMetadata keyspaceMetadata = 
KeyspaceMetadata.create(keyspaceName, attrs.asNewKeyspaceParams());
+        // we deduplicate ReplicationParams here to use the same objects in 
KeyspaceMetadata
+        // as we have as keys in metadata.placements to have a fast map lookup
+        // ReplicationParams are immutable, so it is a safe optimization
+        KeyspaceParams keyspaceParams = keyspaceMetadata.params;
+        ReplicationParams replicationParams = 
metadata.placements.deduplicateReplicationParams(keyspaceParams.replication);

Review Comment:
   Thanks @netudima. Yes, that's right about the deserialize code path. 



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