jacek-lewandowski commented on code in PR #2713:
URL: https://github.com/apache/cassandra/pull/2713#discussion_r1336214857


##########
src/java/org/apache/cassandra/schema/Schema.java:
##########
@@ -77,8 +77,19 @@ public class Schema implements SchemaProvider
 
     public static final Schema instance = new Schema();
 
-    private volatile Keyspaces distributedKeyspaces = Keyspaces.none();
-    private volatile Keyspaces distributedAndLocalKeyspaces;
+    private static class Holder
+    {
+        private final Keyspaces distributedKeyspaces;
+        private final Keyspaces distributedAndLocalKeyspaces;
+
+        private Holder(Keyspaces distributedKeyspaces, Keyspaces 
distributedAndLocalKeyspaces)

Review Comment:
   yes, instead of making getter synchronized as it would be slower and lead to 
deadlocks.



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