mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
add warning for null value in named scenarios
This commit is contained in:
parent
a1c39f7d08
commit
3746037bd7
@ -1,11 +1,13 @@
|
||||
package io.nosqlbench.engine.api.activityconfig.rawyaml;
|
||||
|
||||
import io.nosqlbench.nb.api.errors.BasicError;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class RawScenarios {
|
||||
|
||||
public static String STEPNAME = "%03d";
|
||||
private Map<String, Map<String, String>> scenarios = new LinkedHashMap<>();
|
||||
private final Map<String, Map<String, String>> scenarios = new LinkedHashMap<>();
|
||||
|
||||
public List<String> getScenarioNames() {
|
||||
return new ArrayList<>(scenarios.keySet());
|
||||
@ -20,6 +22,9 @@ public class RawScenarios {
|
||||
for (Map.Entry<String, Object> namedEntry : rawNamedScenarios.entrySet()) {
|
||||
String scenarioName = namedEntry.getKey();
|
||||
Object scenarioObj = namedEntry.getValue();
|
||||
if (scenarioObj == null) {
|
||||
throw new BasicError("Unable to use a null value for scenario named " + scenarioName + " in yaml.");
|
||||
}
|
||||
if (scenarioObj instanceof CharSequence) {
|
||||
scenarios.put(scenarioName, Map.of(String.format(STEPNAME, 1), scenarioObj.toString()));
|
||||
} else if (scenarioObj instanceof List) {
|
||||
|
Loading…
Reference in New Issue
Block a user