cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1069526 - /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliClient.java
Date Thu, 10 Feb 2011 18:51:00 GMT
Author: jbellis
Date: Thu Feb 10 18:51:00 2011
New Revision: 1069526

URL: http://svn.apache.org/viewvc?rev=1069526&view=rev
Log:
validate read_repair_chance
patch by xedin; reviewed by jbellis for CASSANDRA-2146

Modified:
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliClient.java

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliClient.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliClient.java?rev=1069526&r1=1069525&r2=1069526&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliClient.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliClient.java Thu
Feb 10 18:51:00 2011
@@ -870,7 +870,12 @@ public class CliClient extends CliUserHe
                 cfDef.setKey_cache_size(Double.parseDouble(mValue));
                 break;
             case READ_REPAIR_CHANCE:
-                cfDef.setRead_repair_chance(Double.parseDouble(mValue));
+                double chance = Double.parseDouble(mValue) / 100;
+
+                if (chance > 1)
+                    throw new RuntimeException("Error: read_repair_chance / 100 should not
be greater than 1.");
+
+                cfDef.setRead_repair_chance(chance);
                 break;
             case GC_GRACE:
                 cfDef.setGc_grace_seconds(Integer.parseInt(mValue));



Mime
View raw message