mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-11-23 09:16:37 -06:00
re-use base config model
This commit is contained in:
parent
eae115afae
commit
ceee8c59c0
@ -29,6 +29,6 @@ public class DynamoDBDriverAdapter extends BaseDriverAdapter<DynamoDBOp, DynamoD
|
||||
|
||||
@Override
|
||||
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.flowtypes.Op;
|
||||
import io.nosqlbench.nb.api.config.standard.ConfigModel;
|
||||
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 io.nosqlbench.nb.api.config.standard.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -95,7 +92,8 @@ public abstract class BaseDriverAdapter<R extends Op,S> implements DriverAdapter
|
||||
*/
|
||||
@Override
|
||||
public NBConfigModel getConfigModel() {
|
||||
return ConfigModel.of(this.getClass());
|
||||
return ConfigModel.of(this.getClass())
|
||||
.add(Param.defaultTo("errors","stop","Configure the error handler"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -14,7 +14,7 @@ public class Param<T> {
|
||||
|
||||
private final List<String> names;
|
||||
public final Class<? extends T> type;
|
||||
public String description;
|
||||
private String description;
|
||||
private final T defaultValue;
|
||||
public boolean required;
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* value allows them to be accessed as such.
|
||||
|
Loading…
Reference in New Issue
Block a user