cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [3/6] cassandra git commit: Make stress use client mode to avoid checking commit log size on startup
Date Tue, 04 Oct 2016 15:23:41 GMT
Make stress use client mode to avoid checking commit log size on startup

Patch by Denis Ranger; Reviewed by Paulo Motta for CASSANDRA-12478


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

Branch: refs/heads/trunk
Commit: db869bc77451dfd5e6afec604251c9bef8779c00
Parents: 85ac06c
Author: Denis Ranger <denis.ranger@datastax.com>
Authored: Thu Aug 11 19:28:43 2016 -0400
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Tue Oct 4 16:10:52 2016 +0100

----------------------------------------------------------------------
 CHANGES.txt                                                  | 1 +
 .../src/org/apache/cassandra/stress/StressProfile.java       | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/db869bc7/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index d38bf3e..827a208 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.10
+ * Make stress use client mode to avoid checking commit log size on startup (CASSANDRA-12478)
  * Fix exceptions with new vnode allocation (CASSANDRA-12715)
  * Unify drain and shutdown processes (CASSANDRA-12509)
  * Fix NPE in ComponentOfSlice.isEQ() (CASSANDRA-12706)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/db869bc7/tools/stress/src/org/apache/cassandra/stress/StressProfile.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/StressProfile.java b/tools/stress/src/org/apache/cassandra/stress/StressProfile.java
index 5243d96..c19e0cd 100644
--- a/tools/stress/src/org/apache/cassandra/stress/StressProfile.java
+++ b/tools/stress/src/org/apache/cassandra/stress/StressProfile.java
@@ -35,8 +35,10 @@ import com.google.common.util.concurrent.Uninterruptibles;
 import com.datastax.driver.core.*;
 import com.datastax.driver.core.exceptions.AlreadyExistsException;
 import org.apache.cassandra.config.CFMetaData;
+import org.apache.cassandra.config.Config;
 import org.apache.cassandra.cql3.QueryProcessor;
 import org.apache.cassandra.cql3.statements.CreateKeyspaceStatement;
+import org.apache.cassandra.cql3.statements.CreateTableStatement;
 import org.apache.cassandra.exceptions.RequestValidationException;
 import org.apache.cassandra.exceptions.SyntaxException;
 import org.apache.cassandra.stress.generate.*;
@@ -89,6 +91,10 @@ public class StressProfile implements Serializable
 
     private void init(StressYaml yaml) throws RequestValidationException
     {
+        // Use client mode. Otherwise, users with no read permission on /var/lib/commitlog
won't be able to
+        // use cassandra-stress...
+        Config.setClientMode(true);
+
         keyspaceName = yaml.keyspace;
         keyspaceCql = yaml.keyspace_definition;
         tableName = yaml.table;
@@ -129,7 +135,7 @@ public class StressProfile implements Serializable
         {
             try
             {
-                String name = CFMetaData.compile(tableCql, keyspaceName).cfName;
+                String name = ((CreateTableStatement.RawStatement) QueryProcessor.parseStatement(tableCql)).columnFamily();
                 assert name.equalsIgnoreCase(tableName) : "Name in table_definition doesn't
match table property: '" + name + "' != '" + tableName + "'";
             }
             catch (RuntimeException e)


Mime
View raw message