cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [1/2] git commit: Add back backward compatibility for old style replication factor
Date Fri, 01 Jun 2012 15:40:46 GMT
Updated Branches:
  refs/heads/cassandra-1.1 2247054af -> 1f36de1c7


Add back backward compatibility for old style replication factor

patch by slebresne; reviewed by jbellis for CASSANDRA-4294


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/1f36de1c
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/1f36de1c
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/1f36de1c

Branch: refs/heads/cassandra-1.1
Commit: 1f36de1c7f2bdb10819b9de52bb3c5f3aac84784
Parents: 5c27531
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Fri Jun 1 17:39:35 2012 +0200
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Fri Jun 1 17:39:35 2012 +0200

----------------------------------------------------------------------
 CHANGES.txt                                    |    1 +
 src/java/org/apache/cassandra/config/Avro.java |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1f36de1c/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 0f64565..2fd051c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -70,6 +70,7 @@
  * Avoid deadlock in migration stage (CASSANDRA-3882)
  * Take supercolumn names and deletion info into account in memtable throughput
    (CASSANDRA-4264)
+ * Add back backward compatibility for old style replication factor (CASSANDRA-4294)
 Merged from 1.0:
  * Fix super columns bug where cache is not updated (CASSANDRA-4190)
  * fix maxTimestamp to include row tombstones (CASSANDRA-4116)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1f36de1c/src/java/org/apache/cassandra/config/Avro.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/Avro.java b/src/java/org/apache/cassandra/config/Avro.java
index 7996345..a88eb7f 100644
--- a/src/java/org/apache/cassandra/config/Avro.java
+++ b/src/java/org/apache/cassandra/config/Avro.java
@@ -70,6 +70,7 @@ public class Avro
                 strategyOptions.put(name, e.getValue().toString());
             }
         }
+        maybeAddReplicationFactor(strategyOptions, ks.strategy_class.toString(), ks.replication_factor);
 
         int cfsz = ks.cf_defs.size();
         List<CFMetaData> cfMetaData = new ArrayList<CFMetaData>(cfsz);
@@ -95,6 +96,13 @@ public class Avro
     }
 
     @Deprecated
+    private static void maybeAddReplicationFactor(Map<String, String> options, String
cls, Integer rf)
+    {
+        if (rf != null && (cls.endsWith("SimpleStrategy") || cls.endsWith("OldNetworkTopologyStrategy")))
+            options.put("replication_factor", rf.toString());
+    }
+
+    @Deprecated
     public static CFMetaData cfFromAvro(CfDef cf)
     {
         AbstractType<?> comparator;


Mime
View raw message