diff --git a/pom.xml b/pom.xml index 29a436c4f..a1c6411da 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 @@ -29,11 +30,12 @@ multi spring-data-cassandra 1.12.0.BUILD-SNAPSHOT - 2.0.2.2 + 2.1.9.2 1.0 2.16 - 0.2.5 - 2.1.5 + 0.3.1 + 2.1.11 + 2.1.7.1 @@ -78,7 +80,7 @@ com.datastax.cassandra cassandra-driver-dse - ${cassandra} + ${cassandra-driver-dse.version} slf4j-log4j12 @@ -92,23 +94,20 @@ guava com.google.guava + + netty-handler + io.netty + - com.github.stephenc + com.github.jbellis jamm ${jamm.version} test - - org.slf4j - log4j-over-slf4j - ${slf4j} - test - - org.slf4j jul-to-slf4j @@ -148,9 +147,8 @@ org.cassandraunit - cassandra-unit + cassandra-unit-spring ${cassandra-unit.version} - test cassandra-all @@ -160,13 +158,11 @@ com.datastax.cassandra cassandra-driver-core + + slf4j-log4j12 + org.slf4j + - - - - org.cassandraunit - cassandra-unit-spring - ${cassandra-unit.version} test @@ -190,6 +186,21 @@ ${jodatime} test + + + org.apache.commons + commons-lang3 + 3.1 + test + + + + org.hectorclient + hector-core + 1.1-4 + test + + @@ -213,16 +224,26 @@ cassandra-driver-dse - com.github.stephenc + com.github.jbellis jamm - - org.cassandraunit - cassandra-unit - org.cassandraunit cassandra-unit-spring + + + spring-context + org.springframework + + + spring-test + org.springframework + + + slf4j-log4j12 + org.slf4j + + @@ -266,7 +287,6 @@ org.apache.maven.plugins maven-dependency-plugin - 2.8 org.apache.maven.plugins @@ -293,8 +313,7 @@ ${failsafe.version} 1 - -Xmx1024m -Xss512m - -javaagent:${com.github.stephenc:jamm:jar} + -Xms1g -Xmx1g -Xss256k -javaagent:${com.github.jbellis:jamm:jar} true false diff --git a/spring-cql/pom.xml b/spring-cql/pom.xml index 3f7af89c4..b5a91ce4c 100644 --- a/spring-cql/pom.xml +++ b/spring-cql/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 @@ -72,22 +73,12 @@ org.cassandraunit - cassandra-unit - - - slf4j-log4j12 - org.slf4j - - - guava - com.google.guava - - + cassandra-unit-spring org.apache.cassandra cassandra-all - ${cassandra} + ${cassandra.version} test @@ -100,28 +91,22 @@ - - org.cassandraunit - cassandra-unit-spring - - - guava - com.google.guava - - - com.google.guava guava ${guava} + + org.apache.commons + commons-lang3 + test + maven-jar-plugin - 2.3.1 test-jar diff --git a/spring-cql/src/test/java/org/springframework/cassandra/test/integration/AbstractKeyspaceCreatingIntegrationTest.java b/spring-cql/src/test/java/org/springframework/cassandra/test/integration/AbstractKeyspaceCreatingIntegrationTest.java index 408717200..e93fd4a44 100644 --- a/spring-cql/src/test/java/org/springframework/cassandra/test/integration/AbstractKeyspaceCreatingIntegrationTest.java +++ b/spring-cql/src/test/java/org/springframework/cassandra/test/integration/AbstractKeyspaceCreatingIntegrationTest.java @@ -18,15 +18,20 @@ package org.springframework.cassandra.test.integration; import org.junit.After; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.cassandra.core.CqlOperations; +import org.springframework.cassandra.core.CqlTemplate; import org.springframework.util.StringUtils; +import com.datastax.driver.core.Host; import com.datastax.driver.core.KeyspaceMetadata; import com.datastax.driver.core.Session; +import com.datastax.driver.core.Session.State; /** * Abstract base integration test class that creates a keyspace * * @author Matthew T. Adams + * @author David Webb */ public abstract class AbstractKeyspaceCreatingIntegrationTest extends AbstractEmbeddedCassandraIntegrationTest { @@ -81,7 +86,7 @@ public abstract class AbstractKeyspaceCreatingIntegrationTest extends AbstractEm if (kmd == null) { // then create keyspace String cql = "CREATE KEYSPACE " + keyspace - + " WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};"; + + " WITH durable_writes = false AND replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};"; log.info("creating keyspace {} via CQL [{}]", keyspace, cql); system.execute(cql); @@ -99,15 +104,42 @@ public abstract class AbstractKeyspaceCreatingIntegrationTest extends AbstractEm } else { + debugSession(); + log.info("session already connected to a keyspace; attempting to change to use {}", keyspace); String cql = "USE " + (keyspace == null ? "system" : keyspace) + ";"; - session.execute(cql); + + log.debug(cql); + + getTemplate().execute(cql); log.info("now using keyspace " + keyspace); + } } + protected static CqlOperations getTemplate() { + + return new CqlTemplate(session); + } + + protected static void debugSession() { + if (session == null) { + log.warn("Session is null...cannot debug that"); + return; + } + + State state = session.getState(); + + for (Host h : state.getConnectedHosts()) { + + log.debug(String.format("Session Host dc [%s], rack [%s], ver [%s], state [%s]", h.getDatacenter(), h.getRack(), + h.getCassandraVersion(), h.getState())); + } + + } + @After public void after() { if (dropKeyspaceAfterTest() && keyspace != null) { diff --git a/spring-cql/src/test/java/org/springframework/cassandra/test/integration/config/xml/TestLatencyTracker.java b/spring-cql/src/test/java/org/springframework/cassandra/test/integration/config/xml/TestLatencyTracker.java index 5bd218399..4efbc5586 100644 --- a/spring-cql/src/test/java/org/springframework/cassandra/test/integration/config/xml/TestLatencyTracker.java +++ b/spring-cql/src/test/java/org/springframework/cassandra/test/integration/config/xml/TestLatencyTracker.java @@ -29,13 +29,10 @@ import com.datastax.driver.core.Statement; public class TestLatencyTracker implements LatencyTracker { private final static Logger LOG = LoggerFactory.getLogger(TestLatencyTracker.class); - - /* - * (non-Javadoc) - * @see com.datastax.driver.core.LatencyTracker#update(com.datastax.driver.core.Host, long) - */ + @Override - public void update(Host host, long newLatencyNanos) { + public void update(Host host, Statement statement, Exception exception, long newLatencyNanos) { LOG.info("Latency Tracker: " + host.getAddress() + ", " + newLatencyNanos + " nanoseconds."); } + } diff --git a/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/CreateIndexCqlGeneratorIntegrationTests.java b/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/CreateIndexCqlGeneratorIntegrationTests.java index 0688c8e28..31d4373a5 100644 --- a/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/CreateIndexCqlGeneratorIntegrationTests.java +++ b/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/CreateIndexCqlGeneratorIntegrationTests.java @@ -63,7 +63,7 @@ public class CreateIndexCqlGeneratorIntegrationTests { @Rule public CassandraCQLUnit cassandraCQLUnit = new CassandraCQLUnit(new ClassPathCQLDataSet( "integration/cql/generator/CreateIndexCqlGeneratorIntegrationTests-BasicTest.cql", this.keyspace), - CASSANDRA_CONFIG, CASSANDRA_HOST, CASSANDRA_NATIVE_PORT); + CASSANDRA_CONFIG); @Override public BasicTest unit() { diff --git a/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/IndexLifecycleCqlGeneratorIntegrationTests.java b/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/IndexLifecycleCqlGeneratorIntegrationTests.java index 9afe291a8..bd20a0db8 100644 --- a/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/IndexLifecycleCqlGeneratorIntegrationTests.java +++ b/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/IndexLifecycleCqlGeneratorIntegrationTests.java @@ -44,7 +44,7 @@ public class IndexLifecycleCqlGeneratorIntegrationTests extends AbstractKeyspace @Rule public CassandraCQLUnit cassandraCQLUnit = new CassandraCQLUnit(new ClassPathCQLDataSet( "integration/cql/generator/CreateIndexCqlGeneratorIntegrationTests-BasicTest.cql", this.keyspace), - CASSANDRA_CONFIG, CASSANDRA_HOST, CASSANDRA_NATIVE_PORT); + CASSANDRA_CONFIG); @Test public void lifecycleTest() { diff --git a/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/TableLifecycleIntegrationTest.java b/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/TableLifecycleIntegrationTest.java index e5e4c6905..aad2cf2d9 100644 --- a/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/TableLifecycleIntegrationTest.java +++ b/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/cql/generator/TableLifecycleIntegrationTest.java @@ -52,12 +52,9 @@ public class TableLifecycleIntegrationTest extends AbstractKeyspaceCreatingInteg return true; } - // This only ensures the keyspace exists before each test, while using a static session from the parent object. - // TODO - DW Make this better. @Rule public CassandraCQLUnit cassandraCQLUnit = new CassandraCQLUnit(new ClassPathCQLDataSet( - "cassandraOperationsTest-cql-dataload.cql", this.keyspace), CASSANDRA_CONFIG, CASSANDRA_HOST, - CASSANDRA_NATIVE_PORT); + "cassandraOperationsTest-cql-dataload.cql", this.keyspace), CASSANDRA_CONFIG); @Test public void testDrop() { @@ -100,21 +97,24 @@ public class TableLifecycleIntegrationTest extends AbstractKeyspaceCreatingInteg // assertTable(alterTest.specification, keyspace, session); + DropTableTest dropTest = new DropTableTest(); + dropTest.prepare(); + + log.info(dropTest.cql); + + session.execute(dropTest.cql); + + assertNoTable(dropTest.specification, keyspace, session); + } public class DropTableTest extends DropTableCqlGeneratorTests.DropTableTest { - /* (non-Javadoc) - * @see org.springframework.cassandra.test.unit.core.cql.generator.TableOperationCqlGeneratorTest#specification() - */ @Override public DropTableSpecification specification() { return DropTableSpecification.dropTable().name(createTableTest.specification.getName()); } - /* (non-Javadoc) - * @see org.springframework.cassandra.test.unit.core.cql.generator.TableOperationCqlGeneratorTest#generator() - */ @Override public DropTableCqlGenerator generator() { return new DropTableCqlGenerator(specification); diff --git a/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/template/CQLOperationsTest.java b/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/template/CQLOperationsTest.java index 47b74ec46..e62f28f0f 100644 --- a/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/template/CQLOperationsTest.java +++ b/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/template/CQLOperationsTest.java @@ -96,8 +96,7 @@ public class CQLOperationsTest extends AbstractKeyspaceCreatingIntegrationTest { */ @Rule public CassandraCQLUnit cassandraCQLUnit = new CassandraCQLUnit(new ClassPathCQLDataSet( - "cassandraOperationsTest-cql-dataload.cql", this.keyspace), CASSANDRA_CONFIG, CASSANDRA_HOST, - CASSANDRA_NATIVE_PORT); + "cassandraOperationsTest-cql-dataload.cql", this.keyspace), CASSANDRA_CONFIG); @Before public void setupTemplate() { diff --git a/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/template/async/AsynchronousTest.java b/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/template/async/AsynchronousTest.java index a5c820c63..9a10a0e28 100644 --- a/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/template/async/AsynchronousTest.java +++ b/spring-cql/src/test/java/org/springframework/cassandra/test/integration/core/template/async/AsynchronousTest.java @@ -22,7 +22,7 @@ import org.springframework.cassandra.core.QueryForMapListener; import org.springframework.cassandra.core.QueryForObjectListener; import org.springframework.cassandra.core.QueryOptions; import org.springframework.cassandra.core.RetryPolicy; -import org.springframework.cassandra.support.exception.CassandraInsufficientReplicasAvailableException; +import org.springframework.cassandra.support.exception.CassandraConnectionFailureException; import org.springframework.util.StringUtils; import com.datastax.driver.core.DataType; @@ -238,7 +238,7 @@ public class AsynchronousTest extends AbstractAsynchronousTest { testString_AsynchronousQueryListener_QueryOptions(ConsistencyLevel.ONE); } - @Test(expected = CassandraInsufficientReplicasAvailableException.class) + @Test(expected = CassandraConnectionFailureException.class) public void testString_AsynchronousQueryListener_QueryOptionsWithConsistencyLevel2() throws InterruptedException { testString_AsynchronousQueryListener_QueryOptions(ConsistencyLevel.TWO); } @@ -284,7 +284,7 @@ public class AsynchronousTest extends AbstractAsynchronousTest { testString_QueryForObjectListener_QueryOptions(ConsistencyLevel.ONE); } - @Test(expected = CassandraInsufficientReplicasAvailableException.class) + @Test(expected = CassandraConnectionFailureException.class) public void testString_QueryForObjectListener_QueryOptionsWithConsistencyLevel2() throws Exception { testString_QueryForObjectListener_QueryOptions(ConsistencyLevel.TWO); } @@ -324,7 +324,7 @@ public class AsynchronousTest extends AbstractAsynchronousTest { testString_QueryForMapListener_QueryOptions(ConsistencyLevel.ONE); } - @Test(expected = CassandraInsufficientReplicasAvailableException.class) + @Test(expected = CassandraConnectionFailureException.class) public void testString_QueryForMapListener_QueryOptionsWithConsistencyLevel2() throws Exception { testString_QueryForMapListener_QueryOptions(ConsistencyLevel.TWO); } @@ -381,7 +381,7 @@ public class AsynchronousTest extends AbstractAsynchronousTest { testString_QueryForListListener_QueryOptions(ConsistencyLevel.ONE); } - @Test(expected = CassandraInsufficientReplicasAvailableException.class) + @Test(expected = CassandraConnectionFailureException.class) public void testString_QueryForListListener_QueryOptionsWithConsistencyLevel2() throws Exception { testString_QueryForListListener_QueryOptions(ConsistencyLevel.TWO); } diff --git a/spring-cql/src/test/java/org/springframework/cassandra/test/integration/support/SpringCqlBuildProperties.java b/spring-cql/src/test/java/org/springframework/cassandra/test/integration/support/SpringCqlBuildProperties.java index 792e9e461..384124736 100644 --- a/spring-cql/src/test/java/org/springframework/cassandra/test/integration/support/SpringCqlBuildProperties.java +++ b/spring-cql/src/test/java/org/springframework/cassandra/test/integration/support/SpringCqlBuildProperties.java @@ -76,11 +76,20 @@ public class SpringCqlBuildProperties extends Properties { return getInt("build.cassandra.ssl_storage_port"); } + public long getCqlInitializationTimeout() { + return getLong("build.cql.init.timeout"); + } + public int getInt(String key) { String property = getProperty(key); return Integer.parseInt(property); } + public long getLong(String key) { + String property = getProperty(key); + return Long.parseLong(property); + } + public boolean getBoolean(String key) { return Boolean.parseBoolean(getProperty(key)); } diff --git a/spring-cql/src/test/java/org/springframework/cassandra/test/unit/core/cql/generator/DropKeyspaceCqlGeneratorTests.java b/spring-cql/src/test/java/org/springframework/cassandra/test/unit/core/cql/generator/DropKeyspaceCqlGeneratorTests.java index a6adf4066..3875ccb22 100644 --- a/spring-cql/src/test/java/org/springframework/cassandra/test/unit/core/cql/generator/DropKeyspaceCqlGeneratorTests.java +++ b/spring-cql/src/test/java/org/springframework/cassandra/test/unit/core/cql/generator/DropKeyspaceCqlGeneratorTests.java @@ -35,7 +35,8 @@ public class DropKeyspaceCqlGeneratorTests { * Convenient base class that other test classes can use so as not to repeat the generics declarations. */ public static abstract class DropTableTest extends - KeyspaceOperationCqlGeneratorTest {} + KeyspaceOperationCqlGeneratorTest { + } public static class BasicTest extends DropTableTest { diff --git a/spring-cql/src/test/java/org/springframework/cassandra/test/unit/core/cql/generator/KeyspaceOperationCqlGeneratorTest.java b/spring-cql/src/test/java/org/springframework/cassandra/test/unit/core/cql/generator/KeyspaceOperationCqlGeneratorTest.java index 633071050..895174242 100644 --- a/spring-cql/src/test/java/org/springframework/cassandra/test/unit/core/cql/generator/KeyspaceOperationCqlGeneratorTest.java +++ b/spring-cql/src/test/java/org/springframework/cassandra/test/unit/core/cql/generator/KeyspaceOperationCqlGeneratorTest.java @@ -17,7 +17,7 @@ package org.springframework.cassandra.test.unit.core.cql.generator; import java.util.UUID; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.junit.Test; import org.springframework.cassandra.core.cql.generator.KeyspaceNameCqlGenerator; import org.springframework.cassandra.core.cql.generator.TableNameCqlGenerator; diff --git a/spring-cql/src/test/resources/cassandraOperationsTest-cql-dataload.cql b/spring-cql/src/test/resources/cassandraOperationsTest-cql-dataload.cql index 239ae3e25..6bf20234b 100644 --- a/spring-cql/src/test/resources/cassandraOperationsTest-cql-dataload.cql +++ b/spring-cql/src/test/resources/cassandraOperationsTest-cql-dataload.cql @@ -1,3 +1,3 @@ -create table book (isbn text, title text, author text, pages int, PRIMARY KEY (isbn)); -create table book_alt (isbn text, title text, author text, pages int, PRIMARY KEY (isbn)); +create table if not exists book (isbn text, title text, author text, pages int, PRIMARY KEY (isbn)); +create table if not exists book_alt (isbn text, title text, author text, pages int, PRIMARY KEY (isbn)); insert into book (isbn, title, author, pages) values ('999999999', 'Book of Nines', 'Nine Nine', 999); \ No newline at end of file diff --git a/spring-cql/src/test/resources/org.springframework.cassandra.test.integration.support.SpringCqlBuildProperties.properties b/spring-cql/src/test/resources/org.springframework.cassandra.test.integration.support.SpringCqlBuildProperties.properties index ba2281c73..67a67b8e5 100644 --- a/spring-cql/src/test/resources/org.springframework.cassandra.test.integration.support.SpringCqlBuildProperties.properties +++ b/spring-cql/src/test/resources/org.springframework.cassandra.test.integration.support.SpringCqlBuildProperties.properties @@ -2,3 +2,4 @@ build.cassandra.native_transport_port=@build.cassandra.native_transport_port@ build.cassandra.rpc_port=@build.cassandra.rpc_port@ build.cassandra.storage_port=@build.cassandra.storage_port@ build.cassandra.ssl_storage_port=@build.cassandra.ssl_storage_port@ +build.cql.init.timeout=60000 diff --git a/spring-cql/src/test/resources/spring-cassandra.yaml b/spring-cql/src/test/resources/spring-cassandra.yaml index 9243371e1..a96a878ce 100644 --- a/spring-cql/src/test/resources/spring-cassandra.yaml +++ b/spring-cql/src/test/resources/spring-cassandra.yaml @@ -36,7 +36,8 @@ cluster_name: 'Test Cluster' initial_token: # See http://wiki.apache.org/cassandra/HintedHandoff -hinted_handoff_enabled: true +hinted_handoff_enabled: false + # this defines the maximum amount of time a dead host will have hints # generated. After it has been dead this long, new hints for it will not be # created until it has been seen alive and gone down again. @@ -185,7 +186,7 @@ saved_caches_directory: target/embeddedCassandra/saved_caches # and the CommitLog is simply synced every commitlog_sync_period_in_ms # milliseconds. commitlog_sync: periodic -commitlog_sync_period_in_ms: 10000 +commitlog_sync_period_in_ms: 5000 # The size of the individual commitlog file segments. A commitlog # segment may be archived, deleted, or recycled once all the data @@ -196,7 +197,7 @@ commitlog_sync_period_in_ms: 10000 # archiving commitlog segments (see commitlog_archiving.properties), # then you probably want a finer granularity of archiving; 8 or 16 MB # is reasonable. -commitlog_segment_size_in_mb: 32 +commitlog_segment_size_in_mb: 8 # any class that implements the SeedProvider interface and has a # constructor that takes a Map of parameters will do. @@ -220,8 +221,8 @@ seed_provider: # On the other hand, since writes are almost never IO bound, the ideal # number of "concurrent_writes" is dependent on the number of cores in # your system; (8 * number_of_cores) is a good rule of thumb. -concurrent_reads: 32 -concurrent_writes: 32 +concurrent_reads: 4 +concurrent_writes: 4 # Total memory to use for memtables. Cassandra will flush the largest # memtable when this much memory is used. @@ -293,7 +294,7 @@ native_transport_port: ${build.cassandra.native_transport_port} #native_transport_max_threads: 48 # Whether to start the thrift rpc server. -start_rpc: true +start_rpc: false # The address to bind the Thrift RPC service to -- clients connect # here. Unlike ListenAddress above, you _can_ specify 0.0.0.0 here if @@ -379,7 +380,7 @@ snapshot_before_compaction: false # or dropping of column families. The STRONGLY advised default of true # should be used to provide data safety. If you set this flag to false, you will # lose data on truncation or drop. -auto_snapshot: true +auto_snapshot: false # Add column indexes to a row after its contents reach this size. # Increase if your column values are large, or if you have a very large @@ -419,17 +420,17 @@ compaction_throughput_mb_per_sec: 16 # stream_throughput_outbound_megabits_per_sec: 200 # How long the coordinator should wait for read operations to complete -read_request_timeout_in_ms: 10000 +read_request_timeout_in_ms: 120000 # How long the coordinator should wait for seq or index scans to complete -range_request_timeout_in_ms: 10000 +range_request_timeout_in_ms: 120000 # How long the coordinator should wait for writes to complete -write_request_timeout_in_ms: 10000 +write_request_timeout_in_ms: 120000 # How long the coordinator should wait for truncates to complete # (This can be much longer, because unless auto_snapshot is disabled # we need to flush first so we can snapshot before removing the data.) -truncate_request_timeout_in_ms: 60000 +truncate_request_timeout_in_ms: 120000 # The default timeout for other, miscellaneous operations -request_timeout_in_ms: 10000 +request_timeout_in_ms: 120000 # Enable operation timeout information exchange between nodes to accurately # measure request timeouts, If disabled cassandra will assuming the request @@ -615,7 +616,7 @@ client_encryption_options: # can be: all - all traffic is compressed # dc - traffic between different datacenters is compressed # none - nothing is compressed. -internode_compression: all +internode_compression: none # Enable or disable tcp_nodelay for inter-dc communication. # Disabling it will result in larger (but fewer) network packets being sent, diff --git a/spring-data-cassandra/pom.xml b/spring-data-cassandra/pom.xml index ca3fea116..6a6dade53 100644 --- a/spring-data-cassandra/pom.xml +++ b/spring-data-cassandra/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 @@ -72,7 +73,7 @@ org.cassandraunit - cassandra-unit + cassandra-unit-spring test @@ -81,11 +82,11 @@ - + org.apache.cassandra cassandra-all - ${cassandra} + ${cassandra.version} test @@ -117,6 +118,12 @@ test + + org.hectorclient + hector-core + test + + javax.validation @@ -144,18 +151,18 @@ test - - org.apache.openwebbeans.test - cditest-owb - ${webbeans} - test - - - javax.servlet - servlet-api - 3.0-alpha-1 - test - + + org.apache.openwebbeans.test + cditest-owb + ${webbeans} + test + + + javax.servlet + servlet-api + 3.0-alpha-1 + test + diff --git a/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/test/integration/template/async/AsynchronousCassandraTemplateTest.java b/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/test/integration/template/async/AsynchronousCassandraTemplateTest.java index d7201770b..e48a5593b 100644 --- a/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/test/integration/template/async/AsynchronousCassandraTemplateTest.java +++ b/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/test/integration/template/async/AsynchronousCassandraTemplateTest.java @@ -34,7 +34,7 @@ import org.springframework.cassandra.core.ConsistencyLevel; import org.springframework.cassandra.core.PrimaryKeyType; import org.springframework.cassandra.core.RetryPolicy; import org.springframework.cassandra.core.WriteOptions; -import org.springframework.cassandra.support.exception.CassandraInsufficientReplicasAvailableException; +import org.springframework.cassandra.support.exception.CassandraConnectionFailureException; import org.springframework.context.annotation.Configuration; import org.springframework.data.cassandra.core.CassandraOperations; import org.springframework.data.cassandra.core.CassandraTemplate; @@ -59,7 +59,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; public class AsynchronousCassandraTemplateTest extends AbstractSpringDataEmbeddedCassandraIntegrationTest { @Configuration - public static class Config extends IntegrationTestConfig {} + public static class Config extends IntegrationTestConfig { + } @Table public static class Thing { @@ -80,7 +81,8 @@ public class AsynchronousCassandraTemplateTest extends AbstractSpringDataEmbedde @Column public int number; - public Thing() {} + public Thing() { + } public Thing(String stuff, int number) { this.stuff = stuff; @@ -176,7 +178,7 @@ public class AsynchronousCassandraTemplateTest extends AbstractSpringDataEmbedde testInsertAsynchronously(ConsistencyLevel.ONE); } - @Test(expected = CassandraInsufficientReplicasAvailableException.class) + @Test(expected = CassandraConnectionFailureException.class) public void testInsertAsynchronouslyThrows() throws Exception { testInsertAsynchronously(ConsistencyLevel.TWO); } @@ -221,7 +223,7 @@ public class AsynchronousCassandraTemplateTest extends AbstractSpringDataEmbedde testUpdateAsynchronously(ConsistencyLevel.ONE); } - @Test(expected = CassandraInsufficientReplicasAvailableException.class) + @Test(expected = CassandraConnectionFailureException.class) public void testUpdateAsynchronouslyThrows() throws Exception { testUpdateAsynchronously(ConsistencyLevel.TWO); } @@ -243,7 +245,7 @@ public class AsynchronousCassandraTemplateTest extends AbstractSpringDataEmbedde testDeleteAsynchronously(ConsistencyLevel.ONE); } - @Test(expected = CassandraInsufficientReplicasAvailableException.class) + @Test(expected = CassandraConnectionFailureException.class) public void testDeleteAsynchronouslyThrows() throws Exception { testDeleteAsynchronously(ConsistencyLevel.TWO); } diff --git a/spring-data-cassandra/src/test/resources/org.springframework.data.cassandra.test.integration.support.SpringCassandraBuildProperties.properties b/spring-data-cassandra/src/test/resources/org.springframework.data.cassandra.test.integration.support.SpringCassandraBuildProperties.properties index ba2281c73..97c6cf4a8 100644 --- a/spring-data-cassandra/src/test/resources/org.springframework.data.cassandra.test.integration.support.SpringCassandraBuildProperties.properties +++ b/spring-data-cassandra/src/test/resources/org.springframework.data.cassandra.test.integration.support.SpringCassandraBuildProperties.properties @@ -2,3 +2,4 @@ build.cassandra.native_transport_port=@build.cassandra.native_transport_port@ build.cassandra.rpc_port=@build.cassandra.rpc_port@ build.cassandra.storage_port=@build.cassandra.storage_port@ build.cassandra.ssl_storage_port=@build.cassandra.ssl_storage_port@ +build.cql.init.timeout=60000 \ No newline at end of file diff --git a/spring-data-cassandra/src/test/resources/spring-cassandra.yaml b/spring-data-cassandra/src/test/resources/spring-cassandra.yaml index 5f49dc84f..a96a878ce 100644 --- a/spring-data-cassandra/src/test/resources/spring-cassandra.yaml +++ b/spring-data-cassandra/src/test/resources/spring-cassandra.yaml @@ -1,6 +1,5 @@ # Cassandra storage config YAML -# NOTE: # See http://wiki.apache.org/cassandra/StorageConfiguration for # full explanations of configuration directives # /NOTE @@ -37,7 +36,8 @@ cluster_name: 'Test Cluster' initial_token: # See http://wiki.apache.org/cassandra/HintedHandoff -hinted_handoff_enabled: true +hinted_handoff_enabled: false + # this defines the maximum amount of time a dead host will have hints # generated. After it has been dead this long, new hints for it will not be # created until it has been seen alive and gone down again. @@ -186,7 +186,7 @@ saved_caches_directory: target/embeddedCassandra/saved_caches # and the CommitLog is simply synced every commitlog_sync_period_in_ms # milliseconds. commitlog_sync: periodic -commitlog_sync_period_in_ms: 10000 +commitlog_sync_period_in_ms: 5000 # The size of the individual commitlog file segments. A commitlog # segment may be archived, deleted, or recycled once all the data @@ -197,7 +197,7 @@ commitlog_sync_period_in_ms: 10000 # archiving commitlog segments (see commitlog_archiving.properties), # then you probably want a finer granularity of archiving; 8 or 16 MB # is reasonable. -commitlog_segment_size_in_mb: 32 +commitlog_segment_size_in_mb: 8 # any class that implements the SeedProvider interface and has a # constructor that takes a Map of parameters will do. @@ -221,8 +221,8 @@ seed_provider: # On the other hand, since writes are almost never IO bound, the ideal # number of "concurrent_writes" is dependent on the number of cores in # your system; (8 * number_of_cores) is a good rule of thumb. -concurrent_reads: 32 -concurrent_writes: 32 +concurrent_reads: 4 +concurrent_writes: 4 # Total memory to use for memtables. Cassandra will flush the largest # memtable when this much memory is used. @@ -291,10 +291,10 @@ native_transport_port: ${build.cassandra.native_transport_port} # transport is used. They are similar to rpc_min_threads and rpc_max_threads, # though the defaults differ slightly. # native_transport_min_threads: 16 -# native_transport_max_threads: 128 +#native_transport_max_threads: 48 # Whether to start the thrift rpc server. -start_rpc: true +start_rpc: false # The address to bind the Thrift RPC service to -- clients connect # here. Unlike ListenAddress above, you _can_ specify 0.0.0.0 here if @@ -380,7 +380,7 @@ snapshot_before_compaction: false # or dropping of column families. The STRONGLY advised default of true # should be used to provide data safety. If you set this flag to false, you will # lose data on truncation or drop. -auto_snapshot: true +auto_snapshot: false # Add column indexes to a row after its contents reach this size. # Increase if your column values are large, or if you have a very large @@ -420,17 +420,17 @@ compaction_throughput_mb_per_sec: 16 # stream_throughput_outbound_megabits_per_sec: 200 # How long the coordinator should wait for read operations to complete -read_request_timeout_in_ms: 10000 +read_request_timeout_in_ms: 120000 # How long the coordinator should wait for seq or index scans to complete -range_request_timeout_in_ms: 10000 +range_request_timeout_in_ms: 120000 # How long the coordinator should wait for writes to complete -write_request_timeout_in_ms: 10000 +write_request_timeout_in_ms: 120000 # How long the coordinator should wait for truncates to complete # (This can be much longer, because unless auto_snapshot is disabled # we need to flush first so we can snapshot before removing the data.) -truncate_request_timeout_in_ms: 60000 +truncate_request_timeout_in_ms: 120000 # The default timeout for other, miscellaneous operations -request_timeout_in_ms: 10000 +request_timeout_in_ms: 120000 # Enable operation timeout information exchange between nodes to accurately # measure request timeouts, If disabled cassandra will assuming the request @@ -616,7 +616,7 @@ client_encryption_options: # can be: all - all traffic is compressed # dc - traffic between different datacenters is compressed # none - nothing is compressed. -internode_compression: all +internode_compression: none # Enable or disable tcp_nodelay for inter-dc communication. # Disabling it will result in larger (but fewer) network packets being sent,