cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1092724 - in /cassandra/branches/cassandra-0.8/src: avro/internode.genavro java/org/apache/cassandra/config/KSMetaData.java
Date Fri, 15 Apr 2011 14:38:23 GMT
Author: jbellis
Date: Fri Apr 15 14:38:23 2011
New Revision: 1092724

URL: http://svn.apache.org/viewvc?rev=1092724&view=rev
Log:
fix schema compatibility w/ 0.7
patch by jbellis; reviewed by gdusbabek for CASSANDRA-2450

Modified:
    cassandra/branches/cassandra-0.8/src/avro/internode.genavro
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/config/KSMetaData.java

Modified: cassandra/branches/cassandra-0.8/src/avro/internode.genavro
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/avro/internode.genavro?rev=1092724&r1=1092723&r2=1092724&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/avro/internode.genavro (original)
+++ cassandra/branches/cassandra-0.8/src/avro/internode.genavro Fri Apr 15 14:38:23 2011
@@ -73,6 +73,7 @@ protocol InterNode {
         string name;
         string strategy_class;
         union{ map<string>, null } strategy_options;
+        union{ int, null } replication_factor;
         array<CfDef> cf_defs;
     }
     

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=1092724&r1=1092723&r2=1092724&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
Fri Apr 15 14:38:23 2011
@@ -115,16 +115,19 @@ public final class KSMetaData
         {
             throw new RuntimeException("Could not create ReplicationStrategy of type " +
ks.strategy_class, ex);
         }
-        Map<String, String> strategyOptions = null;
+
+        Map<String, String> strategyOptions = new HashMap<String, String>();
         if (ks.strategy_options != null)
         {
-            strategyOptions = new HashMap<String, String>();
             for (Map.Entry<CharSequence, CharSequence> e : ks.strategy_options.entrySet())
             {
                 strategyOptions.put(e.getKey().toString(), e.getValue().toString());
             }
         }
-        int cfsz = (int)ks.cf_defs.size();
+        if (ks.replication_factor != null)
+            strategyOptions.put("replication_factor", ks.replication_factor.toString());
+
+        int cfsz = ks.cf_defs.size();
         CFMetaData[] cfMetaData = new CFMetaData[cfsz];
         Iterator<org.apache.cassandra.db.migration.avro.CfDef> cfiter = ks.cf_defs.iterator();
         for (int i = 0; i < cfsz; i++)



Mime
View raw message