cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1185963 - in /cassandra/branches/cassandra-0.8: ./ src/java/org/apache/cassandra/config/ test/unit/org/apache/cassandra/ test/unit/org/apache/cassandra/config/ test/unit/org/apache/cassandra/db/
Date Wed, 19 Oct 2011 04:15:15 GMT
Author: jbellis
Date: Wed Oct 19 04:15:15 2011
New Revision: 1185963

URL: http://svn.apache.org/viewvc?rev=1185963&view=rev
Log:
finish fixing changing durable_writes keyspace option during CF creation
patch by jbellis; reviewed by pyaskevich for CASSANDRA-3292

Modified:
    cassandra/branches/cassandra-0.8/CHANGES.txt
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/config/KSMetaData.java
    cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/SchemaLoader.java
    cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
    cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/db/DefsTest.java

Modified: cassandra/branches/cassandra-0.8/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/CHANGES.txt?rev=1185963&r1=1185962&r2=1185963&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.8/CHANGES.txt Wed Oct 19 04:15:15 2011
@@ -21,6 +21,9 @@
    in lower case (CASSANDRA-3366)
  * CLI `describe cluster;` output should be on separate lines for separate versions
    (CASSANDRA-3170)
+ * fix changing durable_writes keyspace option during CF creation
+   (CASSANDRA-3292)
+
 
 0.8.7
  * Kill server on wrapped OOME such as from FileChannel.map (CASSANDRA-3201)

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/config/DatabaseDescriptor.java?rev=1185963&r1=1185962&r2=1185963&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
Wed Oct 19 04:15:15 2011
@@ -18,10 +18,7 @@
 
 package org.apache.cassandra.config;
 
-import java.io.File;
-import java.io.FileFilter;
-import java.io.IOException;
-import java.io.InputStream;
+import java.io.*;
 import java.net.InetAddress;
 import java.net.URL;
 import java.net.UnknownHostException;

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/config/KSMetaData.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/config/KSMetaData.java?rev=1185963&r1=1185962&r2=1185963&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/config/KSMetaData.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/config/KSMetaData.java
Wed Oct 19 04:15:15 2011
@@ -40,23 +40,6 @@ public final class KSMetaData
     private final Map<String, CFMetaData> cfMetaData;
     public final boolean durableWrites;
 
-    public KSMetaData(String name, Class<? extends AbstractReplicationStrategy> strategyClass,
Map<String, String> strategyOptions, CFMetaData... cfDefs)
-    {
-        this(name, strategyClass, strategyOptions, true, cfDefs);
-    }
-
-    public KSMetaData(String name, Class<? extends AbstractReplicationStrategy> strategyClass,
Map<String, String> strategyOptions, boolean durable_writes, CFMetaData... cfDefs)
-    {
-        this.name = name;
-        this.strategyClass = strategyClass == null ? NetworkTopologyStrategy.class : strategyClass;
-        this.strategyOptions = strategyOptions;
-        Map<String, CFMetaData> cfmap = new HashMap<String, CFMetaData>();
-        for (CFMetaData cfm : cfDefs)
-            cfmap.put(cfm.cfName, cfm);
-        this.cfMetaData = Collections.unmodifiableMap(cfmap);
-        this.durableWrites = durable_writes;
-    }
-
     private KSMetaData(String name, Class<? extends AbstractReplicationStrategy> strategyClass,
Map<String, String> strategyOptions, boolean durableWrites, Iterable<CFMetaData>
cfDefs)
     {
         this.name = name;
@@ -85,6 +68,15 @@ public final class KSMetaData
         return new KSMetaData(Table.SYSTEM_TABLE, LocalStrategy.class, optsWithRF(1), false,
cfDefs);
     }
 
+    public static KSMetaData testMetadata(String name, Class<? extends AbstractReplicationStrategy>
strategyClass, Map<String, String> strategyOptions, CFMetaData... cfDefs)
+    {
+        return new KSMetaData(name, strategyClass, strategyOptions, true, Arrays.asList(cfDefs));
+    }
+
+    public static KSMetaData testMetadataNotDurable(String name, Class<? extends AbstractReplicationStrategy>
strategyClass, Map<String, String> strategyOptions, CFMetaData... cfDefs)
+    {
+        return new KSMetaData(name, strategyClass, strategyOptions, false, Arrays.asList(cfDefs));
+    }
 
     public static Map<String, String> forwardsCompatibleOptions(KsDef ks_def)
     {

Modified: cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/SchemaLoader.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/SchemaLoader.java?rev=1185963&r1=1185962&r2=1185963&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/SchemaLoader.java (original)
+++ cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/SchemaLoader.java Wed
Oct 19 04:15:15 2011
@@ -69,7 +69,7 @@ public class SchemaLoader
         String ks_kcs = "KeyCacheSpace";
         String ks_rcs = "RowCacheSpace";
         String ks_nocommit = "NoCommitlogSpace";
-        
+
         Class<? extends AbstractReplicationStrategy> simple = SimpleStrategy.class;
 
         Map<String, String> opts_rf1 = KSMetaData.optsWithRF(1);
@@ -81,164 +81,163 @@ public class SchemaLoader
         ColumnFamilyType su = ColumnFamilyType.Super;
         AbstractType bytes = BytesType.instance;
 
-        AbstractType composite = CompositeType.getInstance(Arrays.asList(new AbstractType[]{BytesType.instance,
TimeUUIDType.instance, IntegerType.instance}));
+        AbstractType composite = CompositeType.getInstance(Arrays.asList(new AbstractType[]{
BytesType.instance, TimeUUIDType.instance, IntegerType.instance }));
         Map<Byte, AbstractType> aliases = new HashMap<Byte, AbstractType>();
-        aliases.put((byte)'b', BytesType.instance);
-        aliases.put((byte)'t', TimeUUIDType.instance);
+        aliases.put((byte) 'b', BytesType.instance);
+        aliases.put((byte) 't', TimeUUIDType.instance);
         AbstractType dynamicComposite = DynamicCompositeType.getInstance(aliases);
-      
+
         // these column definitions will will be applied to the jdbc utf and integer column
familes respectively.
         Map<ByteBuffer, ColumnDefinition> integerColumn = new HashMap<ByteBuffer,
ColumnDefinition>();
         integerColumn.put(IntegerType.instance.fromString("42"), new ColumnDefinition(
-            IntegerType.instance.fromString("42"),
-            UTF8Type.instance,
-            null,
-            "Column42"));
+                IntegerType.instance.fromString("42"),
+                UTF8Type.instance,
+                null,
+                "Column42"));
         Map<ByteBuffer, ColumnDefinition> utf8Column = new HashMap<ByteBuffer, ColumnDefinition>();
         utf8Column.put(UTF8Type.instance.fromString("fortytwo"), new ColumnDefinition(
-            UTF8Type.instance.fromString("fortytwo"),
-            IntegerType.instance,
-            null,
-            "Column42"));
+                UTF8Type.instance.fromString("fortytwo"),
+                IntegerType.instance,
+                null,
+                "Column42"));
 
         // Keyspace 1
-        schema.add(new KSMetaData(ks1,
-                                  simple,
-                                  opts_rf1,
-
-                                  // Column Families
-                                  standardCFMD(ks1, "Standard1"),
-                                  standardCFMD(ks1, "Standard2"),
-                                  standardCFMD(ks1, "Standard3"),
-                                  standardCFMD(ks1, "Standard4"),
-                                  standardCFMD(ks1, "StandardLong1"),
-                                  standardCFMD(ks1, "StandardLong2"),
-                                  new CFMetaData(ks1,
-                                                 "ValuesWithQuotes",
-                                                 st,
-                                                 BytesType.instance,
-                                                 null)
-                                                 .defaultValidator(UTF8Type.instance),
-                                  superCFMD(ks1, "Super1", LongType.instance),
-                                  superCFMD(ks1, "Super2", LongType.instance),
-                                  superCFMD(ks1, "Super3", LongType.instance),
-                                  superCFMD(ks1, "Super4", UTF8Type.instance),
-                                  superCFMD(ks1, "Super5", bytes),
-                                  indexCFMD(ks1, "Indexed1", true),
-                                  indexCFMD(ks1, "Indexed2", false),
-                                  new CFMetaData(ks1,
-                                                 "StandardInteger1",
-                                                 st,
-                                                 IntegerType.instance,
-                                                 null)
-                                                 .keyCacheSize(0),
-                                  new CFMetaData(ks1,
-                                                 "Counter1",
-                                                 st,
-                                                 bytes,
-                                                 null)
-                                                 .defaultValidator(CounterColumnType.instance)
-                                                 .mergeShardsChance(1.0),
-                                  new CFMetaData(ks1,
-                                                 "SuperCounter1",
-                                                 su,
-                                                 bytes,
-                                                 bytes)
-                                                 .defaultValidator(CounterColumnType.instance),
-                                  jdbcCFMD(ks1, "JdbcInteger", IntegerType.instance).columnMetadata(integerColumn),
-                                  jdbcCFMD(ks1, "JdbcUtf8", UTF8Type.instance).columnMetadata(utf8Column),
-                                  jdbcCFMD(ks1, "JdbcLong", LongType.instance),
-                                  jdbcCFMD(ks1, "JdbcBytes", bytes),
-                                  jdbcCFMD(ks1, "JdbcAscii", AsciiType.instance),
-                                  new CFMetaData(ks1,
-                                                 "StandardComposite",
-                                                 st,
-                                                 composite,
-                                                 null),
-                                  new CFMetaData(ks1,
-                                                 "StandardDynamicComposite",
-                                                 st,
-                                                 dynamicComposite,
-                                                 null)));
+        schema.add(KSMetaData.testMetadata(ks1,
+                                           simple,
+                                           opts_rf1,
+
+                                           // Column Families
+                                           standardCFMD(ks1, "Standard1"),
+                                           standardCFMD(ks1, "Standard2"),
+                                           standardCFMD(ks1, "Standard3"),
+                                           standardCFMD(ks1, "Standard4"),
+                                           standardCFMD(ks1, "StandardLong1"),
+                                           standardCFMD(ks1, "StandardLong2"),
+                                           new CFMetaData(ks1,
+                                                          "ValuesWithQuotes",
+                                                          st,
+                                                          BytesType.instance,
+                                                          null)
+                                                   .defaultValidator(UTF8Type.instance),
+                                           superCFMD(ks1, "Super1", LongType.instance),
+                                           superCFMD(ks1, "Super2", LongType.instance),
+                                           superCFMD(ks1, "Super3", LongType.instance),
+                                           superCFMD(ks1, "Super4", UTF8Type.instance),
+                                           superCFMD(ks1, "Super5", bytes),
+                                           indexCFMD(ks1, "Indexed1", true),
+                                           indexCFMD(ks1, "Indexed2", false),
+                                           new CFMetaData(ks1,
+                                                          "StandardInteger1",
+                                                          st,
+                                                          IntegerType.instance,
+                                                          null)
+                                                   .keyCacheSize(0),
+                                           new CFMetaData(ks1,
+                                                          "Counter1",
+                                                          st,
+                                                          bytes,
+                                                          null)
+                                                   .defaultValidator(CounterColumnType.instance)
+                                                   .mergeShardsChance(1.0),
+                                           new CFMetaData(ks1,
+                                                          "SuperCounter1",
+                                                          su,
+                                                          bytes,
+                                                          bytes)
+                                                   .defaultValidator(CounterColumnType.instance),
+                                           jdbcCFMD(ks1, "JdbcInteger", IntegerType.instance).columnMetadata(integerColumn),
+                                           jdbcCFMD(ks1, "JdbcUtf8", UTF8Type.instance).columnMetadata(utf8Column),
+                                           jdbcCFMD(ks1, "JdbcLong", LongType.instance),
+                                           jdbcCFMD(ks1, "JdbcBytes", bytes),
+                                           jdbcCFMD(ks1, "JdbcAscii", AsciiType.instance),
+                                           new CFMetaData(ks1,
+                                                          "StandardComposite",
+                                                          st,
+                                                          composite,
+                                                          null),
+                                           new CFMetaData(ks1,
+                                                          "StandardDynamicComposite",
+                                                          st,
+                                                          dynamicComposite,
+                                                          null)));
 
         // Keyspace 2
-        schema.add(new KSMetaData(ks2,
-                                  simple,
-                                  opts_rf1,
-
-                                  // Column Families
-                                  standardCFMD(ks2, "Standard1"),
-                                  standardCFMD(ks2, "Standard3"),
-                                  superCFMD(ks2, "Super3", bytes),
-                                  superCFMD(ks2, "Super4", TimeUUIDType.instance),
-                                  indexCFMD(ks2, "Indexed1", true)));
+        schema.add(KSMetaData.testMetadata(ks2,
+                                           simple,
+                                           opts_rf1,
+
+                                           // Column Families
+                                           standardCFMD(ks2, "Standard1"),
+                                           standardCFMD(ks2, "Standard3"),
+                                           superCFMD(ks2, "Super3", bytes),
+                                           superCFMD(ks2, "Super4", TimeUUIDType.instance),
+                                           indexCFMD(ks2, "Indexed1", true)));
 
         // Keyspace 3
-        schema.add(new KSMetaData(ks3,
-                                  simple,
-                                  opts_rf5,
-
-                                  // Column Families
-                                  standardCFMD(ks3, "Standard1"),
-                                  indexCFMD(ks3, "Indexed1", true)));
+        schema.add(KSMetaData.testMetadata(ks3,
+                                           simple,
+                                           opts_rf5,
+
+                                           // Column Families
+                                           standardCFMD(ks3, "Standard1"),
+                                           indexCFMD(ks3, "Indexed1", true)));
 
         // Keyspace 4
-        schema.add(new KSMetaData(ks4,
-                                  simple,
-                                  opts_rf3,
-
-                                  // Column Families
-                                  standardCFMD(ks4, "Standard1"),
-                                  standardCFMD(ks4, "Standard3"),
-                                  superCFMD(ks4, "Super3", bytes),
-                                  superCFMD(ks4, "Super4", TimeUUIDType.instance),
-                                  new CFMetaData(ks4,
-                                                 "Super5",
-                                                 su,
-                                                 TimeUUIDType.instance,
-                                                 bytes)
-                                                 .keyCacheSize(0)));
+        schema.add(KSMetaData.testMetadata(ks4,
+                                           simple,
+                                           opts_rf3,
+
+                                           // Column Families
+                                           standardCFMD(ks4, "Standard1"),
+                                           standardCFMD(ks4, "Standard3"),
+                                           superCFMD(ks4, "Super3", bytes),
+                                           superCFMD(ks4, "Super4", TimeUUIDType.instance),
+                                           new CFMetaData(ks4,
+                                                          "Super5",
+                                                          su,
+                                                          TimeUUIDType.instance,
+                                                          bytes)
+                                                   .keyCacheSize(0)));
 
         // Keyspace 5
-        schema.add(new KSMetaData(ks5,
-                                  simple,
-                                  opts_rf2,
-                                  standardCFMD(ks5, "Standard1"),
-                                  standardCFMD(ks5, "Counter1")
-                                               .defaultValidator(CounterColumnType.instance)));
+        schema.add(KSMetaData.testMetadata(ks5,
+                                           simple,
+                                           opts_rf2,
+                                           standardCFMD(ks5, "Standard1"),
+                                           standardCFMD(ks5, "Counter1")
+                                                   .defaultValidator(CounterColumnType.instance)));
 
         // Keyspace 6
-        schema.add(new KSMetaData(ks6,
-                                  simple,
-                                  opts_rf1,
-                                  indexCFMD(ks6, "Indexed1", true)));
+        schema.add(KSMetaData.testMetadata(ks6,
+                                           simple,
+                                           opts_rf1,
+                                           indexCFMD(ks6, "Indexed1", true)));
 
         // KeyCacheSpace
-        schema.add(new KSMetaData(ks_kcs,
-                                  simple,
-                                  opts_rf1,
-                                  standardCFMD(ks_kcs, "Standard1")
-                                              .keyCacheSize(0.5),
-                                  standardCFMD(ks_kcs, "Standard2")
-                                              .keyCacheSize(1.0),
-                                  standardCFMD(ks_kcs, "Standard3")
-                                              .keyCacheSize(1.0)));
+        schema.add(KSMetaData.testMetadata(ks_kcs,
+                                           simple,
+                                           opts_rf1,
+                                           standardCFMD(ks_kcs, "Standard1")
+                                                   .keyCacheSize(0.5),
+                                           standardCFMD(ks_kcs, "Standard2")
+                                                   .keyCacheSize(1.0),
+                                           standardCFMD(ks_kcs, "Standard3")
+                                                   .keyCacheSize(1.0)));
 
         // RowCacheSpace
-        schema.add(new KSMetaData(ks_rcs,
-                                  simple,
-                                  opts_rf1,
-                                  standardCFMD(ks_rcs, "CFWithoutCache"),
-                                  standardCFMD(ks_rcs, "CachedCF")
-                                              .rowCacheSize(100)));
-
-        schema.add(new KSMetaData(ks_nocommit,
-                simple,
-                opts_rf1,
-                false,
-                standardCFMD(ks_nocommit, "Standard1")));
+        schema.add(KSMetaData.testMetadata(ks_rcs,
+                                           simple,
+                                           opts_rf1,
+                                           standardCFMD(ks_rcs, "CFWithoutCache"),
+                                           standardCFMD(ks_rcs, "CachedCF")
+                                                   .rowCacheSize(100)));
+
+        schema.add(KSMetaData.testMetadataNotDurable(ks_nocommit,
+                                                     simple,
+                                                     opts_rf1,
+                                                     standardCFMD(ks_nocommit, "Standard1")));
+
 
-        
         return schema;
     }
 

Modified: cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java?rev=1185963&r1=1185962&r2=1185963&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
(original)
+++ cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
Wed Oct 19 04:15:15 2011
@@ -80,9 +80,9 @@ public class DatabaseDescriptorTest
         assert DatabaseDescriptor.getNonSystemTables().size() == 0;
         
         // add a few.
-        AddKeyspace ks0 = new AddKeyspace(new KSMetaData("ks0", SimpleStrategy.class, KSMetaData.optsWithRF(3)));
+        AddKeyspace ks0 = new AddKeyspace(KSMetaData.testMetadata("ks0", SimpleStrategy.class,
KSMetaData.optsWithRF(3)));
         ks0.apply();
-        AddKeyspace ks1 = new AddKeyspace(new KSMetaData("ks1", SimpleStrategy.class, KSMetaData.optsWithRF(3)));
+        AddKeyspace ks1 = new AddKeyspace(KSMetaData.testMetadata("ks1", SimpleStrategy.class,
KSMetaData.optsWithRF(3)));
         ks1.apply();
         
         assert DatabaseDescriptor.getTableDefinition("ks0") != null;

Modified: cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/db/DefsTest.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/db/DefsTest.java?rev=1185963&r1=1185962&r2=1185963&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/db/DefsTest.java (original)
+++ cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/db/DefsTest.java Wed Oct
19 04:15:15 2011
@@ -339,7 +339,7 @@ public class DefsTest extends CleanupHel
         DecoratedKey dk = Util.dk("key0");
         CFMetaData newCf = addTestCF("NewKeyspace1", "AddedStandard1", "A new cf for a new
ks");
 
-        KSMetaData newKs = new KSMetaData(newCf.ksName, SimpleStrategy.class, KSMetaData.optsWithRF(5),
newCf);
+        KSMetaData newKs = KSMetaData.testMetadata(newCf.ksName, SimpleStrategy.class, KSMetaData.optsWithRF(5),
newCf);
         
         new AddKeyspace(newKs).apply();
         
@@ -437,7 +437,7 @@ public class DefsTest extends CleanupHel
     {
         assert DatabaseDescriptor.getTableDefinition("EmptyKeyspace") == null;
         
-        KSMetaData newKs = new KSMetaData("EmptyKeyspace", SimpleStrategy.class, KSMetaData.optsWithRF(5));
+        KSMetaData newKs = KSMetaData.testMetadata("EmptyKeyspace", SimpleStrategy.class,
KSMetaData.optsWithRF(5));
 
         new AddKeyspace(newKs).apply();
         assert DatabaseDescriptor.getTableDefinition("EmptyKeyspace") != null;
@@ -473,7 +473,7 @@ public class DefsTest extends CleanupHel
     {
         // create a keyspace to serve as existing.
         CFMetaData cf = addTestCF("UpdatedKeyspace", "AddedStandard1", "A new cf for a new
ks");
-        KSMetaData oldKs = new KSMetaData(cf.ksName, SimpleStrategy.class, KSMetaData.optsWithRF(5),
cf);
+        KSMetaData oldKs = KSMetaData.testMetadata(cf.ksName, SimpleStrategy.class, KSMetaData.optsWithRF(5),
cf);
         
         new AddKeyspace(oldKs).apply();
         
@@ -482,7 +482,7 @@ public class DefsTest extends CleanupHel
         
         // anything with cf defs should fail.
         CFMetaData cf2 = addTestCF(cf.ksName, "AddedStandard2", "A new cf for a new ks");
-        KSMetaData newBadKs = new KSMetaData(cf.ksName, SimpleStrategy.class, KSMetaData.optsWithRF(4),
cf2);
+        KSMetaData newBadKs = KSMetaData.testMetadata(cf.ksName, SimpleStrategy.class, KSMetaData.optsWithRF(4),
cf2);
         try
         {
             new UpdateKeyspace(newBadKs).apply();
@@ -494,7 +494,7 @@ public class DefsTest extends CleanupHel
         }
         
         // names should match.
-        KSMetaData newBadKs2 = new KSMetaData(cf.ksName + "trash", SimpleStrategy.class,
KSMetaData.optsWithRF(4));
+        KSMetaData newBadKs2 = KSMetaData.testMetadata(cf.ksName + "trash", SimpleStrategy.class,
KSMetaData.optsWithRF(4));
         try
         {
             new UpdateKeyspace(newBadKs2).apply();
@@ -505,7 +505,7 @@ public class DefsTest extends CleanupHel
             // expected.
         }
         
-        KSMetaData newKs = new KSMetaData(cf.ksName, OldNetworkTopologyStrategy.class, KSMetaData.optsWithRF(1));
+        KSMetaData newKs = KSMetaData.testMetadata(cf.ksName, OldNetworkTopologyStrategy.class,
KSMetaData.optsWithRF(1));
         new UpdateKeyspace(newKs).apply();
         
         KSMetaData newFetchedKs = DatabaseDescriptor.getKSMetaData(newKs.name);
@@ -518,7 +518,7 @@ public class DefsTest extends CleanupHel
     {
         // create a keyspace with a cf to update.
         CFMetaData cf = addTestCF("UpdatedCfKs", "Standard1added", "A new cf that will be
updated");
-        KSMetaData ksm = new KSMetaData(cf.ksName, SimpleStrategy.class, KSMetaData.optsWithRF(1),
cf);
+        KSMetaData ksm = KSMetaData.testMetadata(cf.ksName, SimpleStrategy.class, KSMetaData.optsWithRF(1),
cf);
         new AddKeyspace(ksm).apply();
         
         assert DatabaseDescriptor.getTableDefinition(cf.ksName) != null;



Mime
View raw message