Mmuzaf commented on code in PR #2334:
URL: https://github.com/apache/cassandra/pull/2334#discussion_r1196622529


##########
src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:
##########
@@ -424,5 +428,140 @@ public void check() throws ConfigurationException
                 logger.warn("{} parameters have been deprecated. They have new 
names and/or value format; For more information, please refer to NEWS.txt", 
deprecationWarnings);
         }
     }
+
+    /**
+     * Creates a YAML instance based on Cassandra's custom configuration 
classes and types. Yaml factory here is used
+     * to {@link org.yaml.snakeyaml.Yaml#dumpAs} and {@link 
org.yaml.snakeyaml.Yaml#load(String)} given object or
+     * string respectively, that in turn is used to serialize and deserialize 
configuration properties.
+     */
+    public static class YamlFactory
+    {
+        private static final List<TypeDescription> scalarCassandraTypes = new 
ArrayList<>();
+        private static final List<TypeDescription> javaBeanCassandraTypes = 
new ArrayList<>();
+        private static volatile YamlFactory instance;
+
+        private YamlFactory()
+        {
+            loadScalarTypeDescriptions(scalarCassandraTypes);
+            loadJavaBeanTypeDescriptions(javaBeanCassandraTypes);
+        }
+
+        public static YamlFactory getInstance()
+        {
+            YamlFactory instance0 = instance;

Review Comment:
   This is only for lazy initialization, as it 'touches' a lot of 
configuration-type classes directly.
   Fixed.



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to