Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.cassandra.exceptions.ConfigurationException;
import org.apache.cassandra.io.util.File;
import org.apache.cassandra.io.util.FileReader;
import org.apache.cassandra.utils.JVMStabilityInspector;
import org.apache.cassandra.utils.MonotonicClock;
import org.apache.cassandra.utils.Overlaps;
import org.json.simple.JSONObject;
Expand Down Expand Up @@ -142,6 +143,11 @@ static Controller fromOptions(Environment env,
{
logger.warn("Unable to parse saved flush size. Using starting value instead:", e);
}
catch (Throwable e)
{
logger.warn("Unable to read controller config file. Using starting value instead:", e);
JVMStabilityInspector.inspectThrowable(e);
}
return new StaticController(env,
scalingParameters,
survivalFactors,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
package org.apache.cassandra.schema;

import org.apache.cassandra.cql3.CQLTester;
import org.apache.cassandra.cql3.UntypedResultSet;
import org.apache.cassandra.exceptions.ConfigurationException;
import org.apache.cassandra.exceptions.InvalidRequestException;

import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.junit.Assert.fail;

Expand Down Expand Up @@ -100,6 +102,25 @@ public void testCreateTableWithMissingClusteringColumn()
"Missing CLUSTERING ORDER for column ck1");
}

@Test
public void testCreatingTableWithLongName() throws Throwable
{
String keyspace = "g38373639353166362d356631322d343864652d393063362d653862616534343165333764_tpch";
String table = "test_create_k8yq1r75bpzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz";

execute(String.format("CREATE KEYSPACE %s with replication = " +
"{ 'class' : 'SimpleStrategy', 'replication_factor' : 1 }",
keyspace));
createTableMayThrow(String.format("CREATE TABLE %s.%s (" +
"key int PRIMARY KEY," +
"val int)", keyspace, table));

execute(String.format("INSERT INTO %s.%s (key,val) VALUES (1,1)", keyspace, table));
flush(keyspace, table);
UntypedResultSet result = execute(String.format("SELECT * from %s.%s", keyspace, table));
assertThat(result.size()).isEqualTo(1);
}

private void expectedFailure(String statement, String errorMsg)
{

Expand Down
Loading