Skip to content
Permalink
Browse files
Integration improvements
  • Loading branch information
ifesdjeen committed Oct 1, 2021
1 parent df40fa3 commit 469533e2944fc12d4c82f13736160dd2eb143d44
Showing 15 changed files with 435 additions and 210 deletions.
@@ -0,0 +1,55 @@
seed: 1

# Default schema provider generates random schema
schema_provider:
default: {}

drop_schema: false
create_schema: true
truncate_table: false

clock:
offset:
offset: 1000

run_time: 10
run_time_unit: "MINUTES"

system_under_test:
println: {}

partition_descriptor_selector:
always_same:
pd: 12345

clustering_descriptor_selector:
default:
modifications_per_lts:
type: "constant"
constant: 2
rows_per_modification:
type: "constant"
constant: 2
operation_kind_weights:
DELETE_RANGE: 1
DELETE_SLICE: 1
DELETE_ROW: 1
DELETE_COLUMN: 1
DELETE_PARTITION: 1
DELETE_COLUMN_WITH_STATICS: 1
INSERT_WITH_STATICS: 24
INSERT: 24
UPDATE_WITH_STATICS: 23
UPDATE: 23
column_mask_bitsets: null
max_partition_size: 100

data_tracker:
no_op: {}

runner:
sequential:
partition_visitors: []

metric_reporter:
no_op: {}
@@ -33,6 +33,11 @@
<name>Harry Integration - External</name>

<dependencies>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
</dependency>

<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>harry-core</artifactId>
@@ -93,9 +93,7 @@ public Object[][] execute(String statement, ConsistencyLevel cl, Object... bindi
{
try
{
Statement st = new SimpleStatement(statement, bindings);
st.setConsistencyLevel(toDriverCl(cl));
return resultSetToObjectArray(session.execute(st));
return resultSetToObjectArray(session.execute(statement, bindings));
}
catch (Throwable t)
{
@@ -134,9 +132,7 @@ private static Object[][] resultSetToObjectArray(ResultSet rs)
public CompletableFuture<Object[][]> executeAsync(String statement, ConsistencyLevel cl, Object... bindings)
{
CompletableFuture<Object[][]> future = new CompletableFuture<>();
Statement st = new SimpleStatement(statement, bindings);
st.setConsistencyLevel(toDriverCl(cl));
Futures.addCallback(session.executeAsync(st),
Futures.addCallback(session.executeAsync(statement, bindings),
new FutureCallback<ResultSet>()
{
public void onSuccess(ResultSet rows)
@@ -185,8 +181,10 @@ public static com.datastax.driver.core.ConsistencyLevel toDriverCl(SystemUnderTe
{
switch (cl)
{
case ALL: return com.datastax.driver.core.ConsistencyLevel.ALL;
case QUORUM: return com.datastax.driver.core.ConsistencyLevel.QUORUM;
case ALL:
return com.datastax.driver.core.ConsistencyLevel.ALL;
case QUORUM:
return com.datastax.driver.core.ConsistencyLevel.QUORUM;
}
throw new IllegalArgumentException("Don't know a CL: " + cl);
}
@@ -33,10 +33,15 @@
<name>Harry Integration - InJVM</name>

<dependencies>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
</dependency>

<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>harry-core</artifactId>
<version>${project.parent.version}</version>
<version>${project.parent.version}</version>
</dependency>

<dependency>
@@ -62,5 +67,12 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<testResources>
<testResource>
<directory>test/resources</directory>
</testResource>
</testResources>
</build>
</project>

This file was deleted.

@@ -30,20 +30,19 @@
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Consumer;

import com.google.common.collect.Iterators;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import harry.core.Configuration;
import org.apache.cassandra.distributed.api.ConsistencyLevel;
import org.apache.cassandra.distributed.api.Feature;
import org.apache.cassandra.distributed.api.ICluster;
import org.apache.cassandra.distributed.api.IInstance;
import org.apache.cassandra.distributed.api.IInstanceConfig;
import org.apache.cassandra.distributed.api.IMessage;
import org.apache.cassandra.distributed.api.IMessageFilters;
import relocated.shaded.com.google.common.collect.Iterators;

public class InJvmSutBase<NODE extends IInstance, CLUSTER extends ICluster<NODE>> implements SystemUnderTest.FaultInjectingSut
{
@@ -0,0 +1,43 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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 harry.runner;

import harry.core.Configuration;
import harry.model.sut.InJvmSut;

import java.io.File;

public class HarryRunnerJvm extends HarryRunner {

public static void main(String[] args) throws Throwable {
InJvmSut.init();

HarryRunnerJvm runner = new HarryRunnerJvm();
File configFile = runner.loadConfig(args);

Configuration configuration = Configuration.fromFile(configFile);
runner.run(configuration);
}


@Override
public void beforeRun(Runner runner) {

}
}

0 comments on commit 469533e

Please sign in to comment.