allow dryrun to be multi-modal

This commit is contained in:
Jonathan Shook 2023-02-05 20:29:52 -06:00
parent 4f827c8031
commit 4e70eb7680
3 changed files with 45 additions and 44 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2022 nosqlbench * Copyright (c) 2022-2023 nosqlbench
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -166,7 +166,7 @@ public abstract class BaseDriverAdapter<R extends Op, S> implements DriverAdapte
.add(Param.optional("instrument", Boolean.class)) .add(Param.optional("instrument", Boolean.class))
.add(Param.optional(List.of("workload", "yaml"), String.class, "location of workload yaml file")) .add(Param.optional(List.of("workload", "yaml"), String.class, "location of workload yaml file"))
.add(Param.optional("driver", String.class)) .add(Param.optional("driver", String.class))
.add(Param.defaultTo("dryrun",false)) .add(Param.defaultTo("dryrun","none").setRegex("(op|jsonnet|none)"))
.asReadOnly(); .asReadOnly();
} }

View File

@ -495,7 +495,8 @@ public class SimpleActivity implements Activity, ProgressCapable, ActivityDefObs
logger.info(() -> "skipped mapping op '" + pop.getName() + "'"); logger.info(() -> "skipped mapping op '" + pop.getName() + "'");
continue; continue;
} }
boolean dryrun = pop.takeStaticConfigOr("dryrun", false); String dryrunSpec = pop.takeStaticConfigOr("dryrun", "none");
boolean dryrun = dryrunSpec.equalsIgnoreCase("op");
DriverAdapter adapter = adapters.get(i); DriverAdapter adapter = adapters.get(i);
OpMapper opMapper = adapter.getOpMapper(); OpMapper opMapper = adapter.getOpMapper();