cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [2/5] git commit: NTS will default unconfigured DC replicas to zero patch by jbellis; reviewed by brandonwilliams for CASSANDRA-4675
Date Thu, 27 Sep 2012 14:30:43 GMT
NTS will default unconfigured DC replicas to zero
patch by jbellis; reviewed by brandonwilliams for CASSANDRA-4675


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

Branch: refs/heads/cassandra-1.1
Commit: 93bd3d896f828b1c2f8b02d7361f33aa67fcbc2b
Parents: 988ea81
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Thu Sep 27 09:29:20 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Thu Sep 27 09:29:20 2012 -0500

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 .../cassandra/locator/NetworkTopologyStrategy.java |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/93bd3d89/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index eeb59e1..e48fbfd 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 1.1.6
+ * NTS will default unconfigured DC replicas to zero (CASSANDRA-4675)
  * use default consistency level in counter validation if none is
    explicitly provide (CASSANDRA-4700)
  * Improve IAuthority interface by introducing fine-grained

http://git-wip-us.apache.org/repos/asf/cassandra/blob/93bd3d89/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java b/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java
index 2f0fed1..b30262c 100644
--- a/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java
+++ b/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java
@@ -140,7 +140,8 @@ public class NetworkTopologyStrategy extends AbstractReplicationStrategy
 
     public int getReplicationFactor(String dc)
     {
-        return datacenters.get(dc);
+        Integer replicas = datacenters.get(dc);
+        return replicas == null ? 0 : replicas;
     }
 
     public Set<String> getDatacenters()


Mime
View raw message