cqld4 partial progress

This commit is contained in:
Jonathan Shook 2021-03-01 16:08:18 -06:00
parent 3543dd8baf
commit 8b0f4615a7
7 changed files with 137 additions and 0 deletions

View File

@ -0,0 +1,18 @@
import io.nosqlbench.engine.api.activityapi.core.SyncAction;
public class Cqld4Action implements SyncAction {
private final Cqld4Activity activity;
public Cqld4Action(int slot, Cqld4Activity activity) {
this.activity = activity;
}
@Override
public int runCycle(long cycle) {
return 0;
}
}

View File

@ -0,0 +1,27 @@
import io.nosqlbench.engine.api.activityapi.planning.OpSequence;
import io.nosqlbench.engine.api.activityconfig.yaml.OpTemplate;
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
import io.nosqlbench.engine.api.activityimpl.OpDispenser;
import io.nosqlbench.engine.api.activityimpl.SimpleActivity;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.function.Function;
public class Cqld4Activity extends SimpleActivity {
private final static Logger logger = LogManager.getLogger(Cqld4Activity.class);
private OpSequence<OpDispenser<Cqld4Op>> sequence;
public Cqld4Activity(ActivityDef activityDef) {
super(activityDef);
}
@Override
public void initActivity() {
super.initActivity();
Function<OpTemplate,OpDispenser<Cqld4Op>> f = Cqld4ReadyOp::new;
sequence = createOpSequence(f);
}
}

View File

@ -0,0 +1,42 @@
import io.nosqlbench.engine.api.activityapi.core.Action;
import io.nosqlbench.engine.api.activityapi.core.ActionDispenser;
import io.nosqlbench.engine.api.activityapi.core.ActivityType;
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
import io.nosqlbench.nb.annotations.Service;
/**
* A new driver which use the Apache Cassandra CQL driver version 4.
* To differentiate code in this module from the initial CQL driver,
* all classes are prefixed with Cqld4. Full docs are in the cqld4.md file.
*/
@Service(value=ActivityType.class,selector = "cqld4")
public class Cqld4ActivityType implements ActivityType<Cqld4Activity> {
@Override
public Cqld4Activity getActivity(ActivityDef activityDef) {
return new Cqld4Activity(activityDef);
}
@Override
public ActionDispenser getActionDispenser(Cqld4Activity activity) {
if (activity.getParams().getOptionalString("async").isPresent()) {
throw new RuntimeException("This driver does not support async mode yet.");
}
return new Cqld4ActionDispenser(activity);
}
private final static class Cqld4ActionDispenser implements ActionDispenser {
private final Cqld4Activity activity;
public Cqld4ActionDispenser(Cqld4Activity activity) {
this.activity = activity;
}
@Override
public Action getAction(int slot) {
return new Cqld4Action(slot, activity);
}
}
}

View File

@ -0,0 +1,2 @@
public class Cqld4Op {
}

View File

@ -0,0 +1,16 @@
import io.nosqlbench.engine.api.activityconfig.yaml.OpTemplate;
import io.nosqlbench.engine.api.activityimpl.OpDispenser;
import java.util.function.Function;
public class Cqld4OpMapper implements Function<OpTemplate, OpDispenser<Cqld4Op>> {
public Cqld4OpMapper(OpTemplate opTemplate) {
}
@Override
public OpDispenser<Cqld4Op> apply(OpTemplate opTemplate) {
return null;
}
}

View File

@ -0,0 +1,13 @@
import io.nosqlbench.engine.api.activityconfig.yaml.OpTemplate;
import io.nosqlbench.engine.api.activityimpl.OpDispenser;
public class Cqld4ReadyOp implements OpDispenser<Cqld4Op> {
public Cqld4ReadyOp(OpTemplate template) {
}
@Override
public Cqld4Op apply(long value) {
return null;
}
}

View File

@ -0,0 +1,19 @@
# cqld4 driver
This is the newly revamped (alpha) driver for cql which uses
the OSS Driver version 4. As there was a significant restructuring
of the APIs between CQL driver 4 and previous versions, this driver
is not a derivative of the previous NoSQLBench CQL driver which
was based on the version 1.9 native driver. Instead, it is a
clean and separate implementation which aims to use the features
of version 4* of the native driver directly.
This means that many features that advanced testers may have been
used to (the syntactical sugar, the surfacing of advanced configuration
properties in simple ways, and so on) will have to be redesigned to
fit with version 4 of the driver. Most users who do basic testing with
direct CQL syntax should see few issues, but advanced testers will need
to consult this documentation specifically to understand the differences
between `cqld4` NB features and `cql` NB features.