io.nosqlbench.engine.api.activityimpl.DiagRunnableOpDispenser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of engine-api Show documentation
Show all versions of engine-api Show documentation
The engine API for nosqlbench;
Provides the interfaces needed to build internal modules for the
nosqlbench core engine
package io.nosqlbench.engine.api.activityimpl;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import io.nosqlbench.engine.api.templating.CommandTemplate;
import java.util.Map;
public class DiagRunnableOpDispenser implements OpDispenser {
private static final Gson gson = new GsonBuilder().setPrettyPrinting().create();
private final CommandTemplate cmdTpl;
public DiagRunnableOpDispenser(CommandTemplate commandTemplate) {
this.cmdTpl = commandTemplate;
}
@Override
public Runnable apply(long value) {
Map command = cmdTpl.getCommand(value);
String body = gson.toJson(command);
return new DiagRunnableOp(body);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy