mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
chromedriver working, verbs alpha
This commit is contained in:
@@ -333,8 +333,9 @@ public class ParsedTemplate {
|
||||
*/
|
||||
public String getPositionalStatement(Function<String, String> tokenFormatter) {
|
||||
StringBuilder sb = new StringBuilder(spans[0]);
|
||||
|
||||
for (int i = 1; i < spans.length; i += 2) {
|
||||
sb.append(tokenFormatter.apply(spans[i]));
|
||||
sb.append(tokenFormatter!=null ? tokenFormatter.apply(spans[i]) : spans[i]);
|
||||
sb.append(spans[i + 1]);
|
||||
}
|
||||
return sb.toString();
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package io.nosqlbench.virtdata.core.templates;
|
||||
|
||||
//import io.nosqlbench.engine.api.activityconfig.ParsedStmt;
|
||||
//import io.nosqlbench.engine.api.activityconfig.yaml.StmtDef;
|
||||
import io.nosqlbench.virtdata.core.bindings.Bindings;
|
||||
import io.nosqlbench.virtdata.core.bindings.BindingsTemplate;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* Uses a string template and a bindings template to create instances of {@link StringBindings}.
|
||||
@@ -18,6 +22,30 @@ public class StringBindingsTemplate {
|
||||
this.bindingsTemplate = bindingsTemplate;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Build a default string bindings template using the standard representation
|
||||
// * for a string template in NoSQLBench, which is a literal string interspersed
|
||||
// * with named anchors in {@code {{curlybraces}}} form.
|
||||
// * @param stmtDef A stmtDef
|
||||
// */
|
||||
// public StringBindingsTemplate(StmtDef stmtDef) {
|
||||
// this(stmtDef, s->"{{"+s+"}}");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Build a string bindings template using a custom representation that maps
|
||||
// * the named anchors to a different form than the default {@code {{curlybraces}}} form.
|
||||
// * The mapping function provides the textual substitution which is used to composite
|
||||
// * the normative representation of the statement.
|
||||
// * @param stmtdef The {@link StmtDef} which provides the bindpoints
|
||||
// * @param tokenMapper A custom named anchor formatting function
|
||||
// */
|
||||
// public StringBindingsTemplate(StmtDef stmtdef, Function<String,String> tokenMapper) {
|
||||
// ParsedStmt parsedStmt = stmtdef.getParsed().orError();
|
||||
// this.stringTemplate = parsedStmt.getPositionalStatement(tokenMapper);
|
||||
// this.bindingsTemplate = new BindingsTemplate(parsedStmt.getBindPoints());
|
||||
// }
|
||||
|
||||
/**
|
||||
* Create a new instance of {@link StringBindings}, preferably in the thread context that will use it.
|
||||
* @return a new StringBindings
|
||||
|
||||
Reference in New Issue
Block a user