mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
apply superset config checking
This commit is contained in:
parent
dbf3df1e33
commit
90bcecc68e
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2022-2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -54,7 +54,6 @@ public class StandardActivity<R extends Op, S> extends SimpleActivity implements
|
||||
|
||||
public StandardActivity(ActivityDef activityDef) {
|
||||
super(activityDef);
|
||||
this.adapters.putAll(adapters);
|
||||
|
||||
Optional<String> yaml_loc = activityDef.getParams().getOptionalString("yaml", "workload");
|
||||
if (yaml_loc.isPresent()) {
|
||||
@ -69,11 +68,14 @@ public class StandardActivity<R extends Op, S> extends SimpleActivity implements
|
||||
Optional<DriverAdapter> defaultAdapter = activityDef.getParams().getOptionalString("driver")
|
||||
.flatMap(s -> ServiceSelector.of(s, adapterLoader).get());
|
||||
|
||||
// HERE, op templates are loaded before drivers are loaded
|
||||
List<OpTemplate> opTemplates = loadOpTemplates(defaultAdapter);
|
||||
|
||||
|
||||
List<ParsedOp> pops = new ArrayList<>();
|
||||
List<DriverAdapter> adapterlist = new ArrayList<>();
|
||||
NBConfigModel supersetConfig = ConfigModel.of(StandardActivity.class).add(yamlmodel);
|
||||
|
||||
for (OpTemplate ot : opTemplates) {
|
||||
ParsedOp incompleteOpDef = new ParsedOp(ot, NBConfiguration.empty(), List.of());
|
||||
String driverName = incompleteOpDef.takeOptionalStaticValue("driver", String.class)
|
||||
@ -94,6 +96,8 @@ public class StandardActivity<R extends Op, S> extends SimpleActivity implements
|
||||
|
||||
if (adapter instanceof NBConfigurable configurable) {
|
||||
NBConfigModel adapterModel = configurable.getConfigModel();
|
||||
supersetConfig.add(adapterModel);
|
||||
|
||||
combinedModel = adapterModel.add(yamlmodel);
|
||||
combinedConfig = combinedModel.matchConfig(activityDef.getParams());
|
||||
configurable.applyConfig(combinedConfig);
|
||||
@ -101,6 +105,8 @@ public class StandardActivity<R extends Op, S> extends SimpleActivity implements
|
||||
adapters.put(driverName, adapter);
|
||||
mappers.put(driverName, adapter.getOpMapper());
|
||||
}
|
||||
supersetConfig.assertValidConfig(activityDef.getParams().getStringStringMap());
|
||||
|
||||
|
||||
DriverAdapter adapter = adapters.get(driverName);
|
||||
adapterlist.add(adapter);
|
||||
|
Loading…
Reference in New Issue
Block a user