diff --git a/nb-api/src/main/java/io/nosqlbench/nb/api/config/standard/NBConfiguration.java b/nb-api/src/main/java/io/nosqlbench/nb/api/config/standard/NBConfiguration.java index b089c2ef3..c3b4770bb 100644 --- a/nb-api/src/main/java/io/nosqlbench/nb/api/config/standard/NBConfiguration.java +++ b/nb-api/src/main/java/io/nosqlbench/nb/api/config/standard/NBConfiguration.java @@ -74,8 +74,9 @@ public class NBConfiguration { if (param==null) { throw new NBConfigError("Parameter named '" + name + "' is not valid for " + model.getOf().getSimpleName() + "."); } - if (!param.isRequired()) { - throw new NBConfigError("Non-optional get on parameter declared optional '" + name + "'"); + if ((!param.isRequired())&¶m.getDefaultValue()==null) { + throw new RuntimeException("Non-optional get on optional parameter " + name + "' which has no default value while configuring " + model.getOf() + "." + + "\nTo avoid user impact, ensure that ConfigModel and NBConfigurable usage are aligned."); } Object o = data.get(name); diff --git a/nb-api/src/main/java/io/nosqlbench/nb/api/config/standard/Param.java b/nb-api/src/main/java/io/nosqlbench/nb/api/config/standard/Param.java index 5654b7770..79f3dae83 100644 --- a/nb-api/src/main/java/io/nosqlbench/nb/api/config/standard/Param.java +++ b/nb-api/src/main/java/io/nosqlbench/nb/api/config/standard/Param.java @@ -77,12 +77,28 @@ public class Param { return new Param(List.of(name), type, null, false, null); } + /** + * 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 + * @return + */ public static Param defaultTo(String name, V defaultValue) { - return new Param(List.of(name), (Class) defaultValue.getClass(), null, false, null); + return new Param(List.of(name), (Class) 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 names + * @param defaultValue + * @param + * @return + */ public static Param defaultTo(List names, V defaultValue) { - return new Param(names, (Class) defaultValue.getClass(), null, false, null); + return new Param(names, (Class) defaultValue.getClass(), null, true, defaultValue); } public static Param required(String name, Class type) { diff --git a/nb/pom.xml b/nb/pom.xml index 1c0742bfb..ff98f15be 100644 --- a/nb/pom.xml +++ b/nb/pom.xml @@ -93,18 +93,6 @@ 4.15.52-SNAPSHOT - - io.nosqlbench - driver-dsegraph-shaded - 4.15.52-SNAPSHOT - - - - io.nosqlbench - driver-cql-shaded - 4.15.52-SNAPSHOT - - io.nosqlbench driver-cqld3-shaded @@ -222,6 +210,32 @@ + + with-dsegraph-d1 + + true + + + + io.nosqlbench + driver-dsegraph-shaded + 4.15.52-SNAPSHOT + + + + + with-cql-d1 + + true + + + + io.nosqlbench + driver-cql-shaded + 4.15.52-SNAPSHOT + + + with-cql-d4