diff --git a/pom.xml b/pom.xml index e258bc5..e4797cf 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ com.datastax.cassandra cassandra-driver-core - 2.2.0-rc1 + 3.0.0-rc1 diff --git a/src/main/java/com/metawiring/load/core/ExecutionContext.java b/src/main/java/com/metawiring/load/core/ExecutionContext.java index 69c7cb8..09feb93 100644 --- a/src/main/java/com/metawiring/load/core/ExecutionContext.java +++ b/src/main/java/com/metawiring/load/core/ExecutionContext.java @@ -20,9 +20,7 @@ import com.codahale.metrics.MetricRegistry; import com.codahale.metrics.ScheduledReporter; -import com.datastax.driver.core.Cluster; -import com.datastax.driver.core.ProtocolOptions; -import com.datastax.driver.core.Session; +import com.datastax.driver.core.*; import com.metawiring.load.config.TestClientConfig; import com.metawiring.load.generator.*; import org.joda.time.Interval; @@ -52,6 +50,7 @@ public TestClientConfig getConfig() { public void startup() { Cluster.Builder builder = Cluster.builder() + .withTimestampGenerator(ServerSideTimestampGenerator.INSTANCE) .addContactPoint(config.host) .withPort(config.port) .withCompression(ProtocolOptions.Compression.NONE); diff --git a/src/main/resources/activities/read-tenfields-random.yaml b/src/main/resources/activities/read-tenfields-random.yaml index 01b536d..b01bfdd 100644 --- a/src/main/resources/activities/read-tenfields-random.yaml +++ b/src/main/resources/activities/read-tenfields-random.yaml @@ -2,6 +2,6 @@ dml: - name: read-tenfields-random cql: | select * from <>.<>_tenfields - where key=? + where key=<> bindings: key: RandomStringRangeGenerator:1:50000000 \ No newline at end of file diff --git a/src/test/java/com/metawiring/load/generators/RandomStringRangeGeneratorTest.java b/src/test/java/com/metawiring/load/generators/RandomStringRangeGeneratorTest.java new file mode 100644 index 0000000..77b0d47 --- /dev/null +++ b/src/test/java/com/metawiring/load/generators/RandomStringRangeGeneratorTest.java @@ -0,0 +1,33 @@ +/* + * + * Copyright 2015 Jonathan Shook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.metawiring.load.generators; + +import org.testng.annotations.Test; + +import static org.testng.Assert.*; + +public class RandomStringRangeGeneratorTest { + + @Test + public void shouldReturnCorrectType() { + RandomStringRangeGenerator rsrg = new RandomStringRangeGenerator("1000","2000"); + String s = rsrg.get(); + } + +} \ No newline at end of file