Skip to content

Commit

Permalink
cassandra-stress: switch create table to use keyspace.table format
Browse files Browse the repository at this point in the history
Stop using "Use keyspace" since it can fail when using multiple
stress commands in parallel due to a race condition.

fixes: #356
  • Loading branch information
roydahan committed Nov 30, 2023
1 parent 26f5f71 commit e3c1d8b
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ public void createKeySpacesNative(StressSettings settings)
{
//Keyspace
client.execute(createKeyspaceStatementCQL3(), org.apache.cassandra.db.ConsistencyLevel.LOCAL_ONE);

client.execute("USE \""+keyspace+"\"", org.apache.cassandra.db.ConsistencyLevel.LOCAL_ONE);


//Add standard1
client.execute(createStandard1StatementCQL3(settings), org.apache.cassandra.db.ConsistencyLevel.LOCAL_ONE);

Expand Down Expand Up @@ -152,7 +150,7 @@ String createStandard1StatementCQL3(StressSettings settings)
StringBuilder b = new StringBuilder();

b.append("CREATE TABLE IF NOT EXISTS ")
.append("standard1 (key blob PRIMARY KEY ");
.append("\""+keyspace+"\"".standard1 (key blob PRIMARY KEY ");
try
{
Expand Down

0 comments on commit e3c1d8b

Please sign in to comment.