Author: jbellis
Date: Thu May 26 19:26:23 2011
New Revision: 1128052

URL: http://svn.apache.org/viewvc?rev=1128052&view=rev
Log:
support null strategy_options for backwards compatibility
patch by Jon Hermes; reviewed by jbellis for CASSANDRA-2713

Modified:
    cassandra/branches/cassandra-0.8.0/CHANGES.txt
    
cassandra/branches/cassandra-0.8.0/src/java/org/apache/cassandra/config/KSMetaData.java

Modified: cassandra/branches/cassandra-0.8.0/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.0/CHANGES.txt?rev=1128052&r1=1128051&r2=1128052&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8.0/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.8.0/CHANGES.txt Thu May 26 19:26:23 2011
@@ -7,7 +7,7 @@
  * switch to native Thrift for Hadoop map/reduce (CASSANDRA-2667)
  * fix StackOverflowError when building from eclipse (CASSANDRA-2687)
  * only provide replication_factor to strategy_options "help" for
-   SimpleStrategy, OldNetworkTopologyStrategy (CASSANDRA-2678)
+   SimpleStrategy, OldNetworkTopologyStrategy (CASSANDRA-2678, 2713)
  * fix exception adding validators to non-string columns (CASSANDRA-2696)
  * avoid instantiating DatabaseDescriptor in JDBC (CASSANDRA-2694)
  * fix potential stack overflow during compaction (CASSANDRA-2626)

Modified: 
cassandra/branches/cassandra-0.8.0/src/java/org/apache/cassandra/config/KSMetaData.java
URL: 
http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.0/src/java/org/apache/cassandra/config/KSMetaData.java?rev=1128052&r1=1128051&r2=1128052&view=diff
==============================================================================
--- 
cassandra/branches/cassandra-0.8.0/src/java/org/apache/cassandra/config/KSMetaData.java
 (original)
+++ 
cassandra/branches/cassandra-0.8.0/src/java/org/apache/cassandra/config/KSMetaData.java
 Thu May 26 19:26:23 2011
@@ -51,7 +51,10 @@ public final class KSMetaData
 
     public static Map<String, String> forwardsCompatibleOptions(KsDef ks_def)
     {
-        Map<String, String> options = new HashMap<String, 
String>(ks_def.strategy_options);
+        Map<String, String> options;
+        options = ks_def.strategy_options == null
+                ? new HashMap<String, String>()
+                : new HashMap<String, String>(ks_def.strategy_options);
         maybeAddReplicationFactor(options, ks_def.strategy_class, 
ks_def.isSetReplication_factor() ? ks_def.replication_factor : null);
         return options;
     }


Reply via email to