mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
re-use base config model
This commit is contained in:
@@ -29,6 +29,6 @@ public class DynamoDBDriverAdapter extends BaseDriverAdapter<DynamoDBOp, DynamoD
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBConfigModel getConfigModel() {
|
public NBConfigModel getConfigModel() {
|
||||||
return DynamoDBSpace.getConfigModel();
|
return super.getConfigModel().add(DynamoDBSpace.getConfigModel());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ package io.nosqlbench.engine.api.activityimpl.uniform;
|
|||||||
|
|
||||||
import io.nosqlbench.engine.api.activityimpl.uniform.fieldmappers.FieldDestructuringMapper;
|
import io.nosqlbench.engine.api.activityimpl.uniform.fieldmappers.FieldDestructuringMapper;
|
||||||
import io.nosqlbench.engine.api.activityimpl.uniform.flowtypes.Op;
|
import io.nosqlbench.engine.api.activityimpl.uniform.flowtypes.Op;
|
||||||
import io.nosqlbench.nb.api.config.standard.ConfigModel;
|
import io.nosqlbench.nb.api.config.standard.*;
|
||||||
import io.nosqlbench.nb.api.config.standard.NBConfigModel;
|
|
||||||
import io.nosqlbench.nb.api.config.standard.NBConfigurable;
|
|
||||||
import io.nosqlbench.nb.api.config.standard.NBConfiguration;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -95,7 +92,8 @@ public abstract class BaseDriverAdapter<R extends Op,S> implements DriverAdapter
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public NBConfigModel getConfigModel() {
|
public NBConfigModel getConfigModel() {
|
||||||
return ConfigModel.of(this.getClass());
|
return ConfigModel.of(this.getClass())
|
||||||
|
.add(Param.defaultTo("errors","stop","Configure the error handler"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public class Param<T> {
|
|||||||
|
|
||||||
private final List<String> names;
|
private final List<String> names;
|
||||||
public final Class<? extends T> type;
|
public final Class<? extends T> type;
|
||||||
public String description;
|
private String description;
|
||||||
private final T defaultValue;
|
private final T defaultValue;
|
||||||
public boolean required;
|
public boolean required;
|
||||||
private Pattern regex;
|
private Pattern regex;
|
||||||
@@ -89,6 +89,18 @@ public class Param<T> {
|
|||||||
return new Param<V>(List.of(name), (Class<V>) defaultValue.getClass(), null, true, defaultValue);
|
return new Param<V>(List.of(name), (Class<V>) defaultValue.getClass(), null, true, defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parameters which are given a default value are automatically marked as required, as the default
|
||||||
|
* value allows them to be accessed as such.
|
||||||
|
* @param name
|
||||||
|
* @param defaultValue
|
||||||
|
* @param <V>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <V> Param<V> defaultTo(String name, V defaultValue, String description) {
|
||||||
|
return new Param<V>(List.of(name), (Class<V>) defaultValue.getClass(), description, true, defaultValue);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parameters which are given a default value are automatically marked as required, as the default
|
* Parameters which are given a default value are automatically marked as required, as the default
|
||||||
* value allows them to be accessed as such.
|
* value allows them to be accessed as such.
|
||||||
|
|||||||
Reference in New Issue
Block a user