mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
migrate stdout to adapter API
This commit is contained in:
parent
a39f4e1a27
commit
13484193d9
@ -19,6 +19,7 @@ package io.nosqlbench.activitytype.stdout;
|
||||
|
||||
import com.codahale.metrics.Histogram;
|
||||
import com.codahale.metrics.Timer;
|
||||
import io.nosqlbench.adapters.stdout.TemplateFormat;
|
||||
import io.nosqlbench.engine.api.activityapi.core.ActivityDefObserver;
|
||||
import io.nosqlbench.engine.api.activityapi.planning.OpSequence;
|
||||
import io.nosqlbench.engine.api.activityapi.planning.SequencePlanner;
|
||||
|
@ -13,13 +13,12 @@ public class StdoutActivityType implements ActivityType<StdoutActivity> {
|
||||
|
||||
@Override
|
||||
public StdoutActivity getActivity(ActivityDef activityDef) {
|
||||
Optional<String> yaml = activityDef.getParams().getOptionalString("yaml", "workload");
|
||||
|
||||
|
||||
// sanity check that we have a yaml parameter, which contains our statements and bindings
|
||||
if (!yaml.isPresent()) {
|
||||
throw new RuntimeException("Currently, the stdout activity type requires yaml/workload activity parameter" +
|
||||
".");
|
||||
Optional<String> stmtsrc = activityDef.getParams().getOptionalString("op", "stmt", "statement", "yaml", "workload");
|
||||
if (stmtsrc.isEmpty()) {
|
||||
throw new RuntimeException("Without a workload or op parameter, there is nothing to do. (Add a workload (yaml file) or an op= template, like" +
|
||||
" op='cycle={{Identity()}}'");
|
||||
}
|
||||
|
||||
return new StdoutActivity(activityDef);
|
||||
|
Loading…
Reference in New Issue
Block a user