SkipNullRepresenter representer = new SkipNullRepresenter();
/* Use Tag.MAP to avoid the class name being included as global tag */
representer.addClassTag(Config.class, Tag.MAP);
representer.addClassTag(RawColumnFamily.class, Tag.MAP);
Dumper dumper = new Dumper(representer, options);
Yaml yaml = new Yaml(dumper);
String output = yaml.dump(conf);
/* Write to output file */
BufferedWriter out = new BufferedWriter(new FileWriter(outfile));
out.write("# Cassandra YAML generated from previous config\n");
out.write("# Configuration wiki: http://wiki.apache.org/cassandra/StorageConfiguration\n");