cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject git commit: allow num_tokens to be unspecified, as described in the yaml
Date Sun, 18 May 2014 00:43:45 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 eaa78e085 -> 58dc48889


allow num_tokens to be unspecified, as described in the yaml


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

Branch: refs/heads/cassandra-2.0
Commit: 58dc48889536878bab2dfc67ed892b27cde03558
Parents: eaa78e0
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Sat May 17 20:43:06 2014 -0400
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Sat May 17 20:43:06 2014 -0400

----------------------------------------------------------------------
 src/java/org/apache/cassandra/config/DatabaseDescriptor.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/58dc4888/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 6417524..a368cdb 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -439,7 +439,9 @@ public class DatabaseDescriptor
             for (String token : tokensFromString(conf.initial_token))
                 partitioner.getTokenFactory().validate(token);
 
-        if (conf.num_tokens > MAX_NUM_TOKENS)
+        if (conf.num_tokens == null)
+        	conf.num_tokens = 1;
+        else if (conf.num_tokens > MAX_NUM_TOKENS)
             throw new ConfigurationException(String.format("A maximum number of %d tokens
per node is supported", MAX_NUM_TOKENS));
 
         try


Mime
View raw message