mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
correct mispelling of parametrized
This commit is contained in:
parent
40a2562e90
commit
832064c89a
@ -161,17 +161,21 @@ public class CqlActivity extends SimpleActivity implements Activity, ActivityDef
|
||||
|
||||
ParsedStmt parsed = stmtDef.getParsed().orError();
|
||||
boolean prepared = stmtDef.getParamOrDefault("prepared", true);
|
||||
boolean parametrized = stmtDef.getParamOrDefault("parametrized", false);
|
||||
if (stmtDef.getOptionalStringParam("parametrized").isPresent()) {
|
||||
throw new RuntimeException("Please use 'parameterized' instead of 'parametrized'. This was recently " +
|
||||
"corrected. This warning will be removed in the future.");
|
||||
}
|
||||
boolean parameterized = stmtDef.getParamOrDefault("parameterized", false);
|
||||
long ratio = stmtDef.getParamOrDefault("ratio", 1);
|
||||
|
||||
Optional<ConsistencyLevel> cl = stmtDef.getOptionalStringParam("cl", String.class).map(ConsistencyLevel::valueOf);
|
||||
Optional<ConsistencyLevel> serial_cl = stmtDef.getOptionalStringParam("serial_cl").map(ConsistencyLevel::valueOf);
|
||||
Optional<Boolean> idempotent = stmtDef.getOptionalStringParam("idempotent",Boolean.class);
|
||||
Optional<Boolean> idempotent = stmtDef.getOptionalStringParam("idempotent", Boolean.class);
|
||||
|
||||
StringBuilder psummary = new StringBuilder();
|
||||
|
||||
boolean instrument = stmtDef.getOptionalStringParam("instrument",Boolean.class)
|
||||
.or(() -> getParams().getOptionalBoolean("instrument"))
|
||||
boolean instrument = stmtDef.getOptionalStringParam("instrument", Boolean.class)
|
||||
.or(() -> getParams().getOptionalBoolean("instrument"))
|
||||
.orElse(false);
|
||||
|
||||
String logresultcsv = stmtDef.getParamOrDefault("logresultcsv", "");
|
||||
@ -225,7 +229,7 @@ public class CqlActivity extends SimpleActivity implements Activity, ActivityDef
|
||||
simpleStatement.setIdempotent(i);
|
||||
});
|
||||
template = new ReadyCQLStatementTemplate(fconfig, getSession(), simpleStatement, ratio,
|
||||
parsed.getName(), parametrized);
|
||||
parsed.getName(), parameterized);
|
||||
}
|
||||
|
||||
stmtDef.getOptionalStringParam("save")
|
||||
|
@ -8,27 +8,27 @@ import io.nosqlbench.virtdata.core.bindings.ValuesArrayBinder;
|
||||
/**
|
||||
* This binder is not meant to be used with anything but DDL or statements
|
||||
* which should not be trying to parameterize values in general.
|
||||
* Parametrized values are still possible through parametrized constructor parameter.
|
||||
* Parametrized values are still possible through parameterized constructor parameter.
|
||||
* This binder should be avoided in favor of binders returning PreparedStatement
|
||||
*/
|
||||
public class SimpleStatementValuesBinder
|
||||
implements ValuesArrayBinder<SimpleStatement, Statement> {
|
||||
|
||||
private final boolean parametrized;
|
||||
private final boolean parameterized;
|
||||
|
||||
public SimpleStatementValuesBinder(boolean parametrized){
|
||||
this.parametrized = parametrized;
|
||||
public SimpleStatementValuesBinder(boolean parameterized) {
|
||||
this.parameterized = parameterized;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Statement bindValues(SimpleStatement context, Object[] values) {
|
||||
String query = context.getQueryString();
|
||||
if(parametrized) {
|
||||
if (parameterized) {
|
||||
String[] splits = query.split("\\?");
|
||||
assert splits.length == values.length+1;
|
||||
assert splits.length == values.length + 1;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(splits[0]);
|
||||
for(int i = 1; i < splits.length; i++) {
|
||||
for (int i = 1; i < splits.length; i++) {
|
||||
sb.append(values[i - 1]);
|
||||
sb.append(splits[i]);
|
||||
}
|
||||
|
@ -25,9 +25,9 @@ public class ReadyCQLStatementTemplate {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(ReadyCQLStatementTemplate.class);
|
||||
private final Session session;
|
||||
private ContextualBindingsArrayTemplate<?, Statement> template;
|
||||
private long ratio;
|
||||
private String name;
|
||||
private final ContextualBindingsArrayTemplate<?, Statement> template;
|
||||
private final long ratio;
|
||||
private final String name;
|
||||
|
||||
private ResultSetCycleOperator[] resultSetCycleOperators;
|
||||
private RowCycleOperator[] rowCycleOperators;
|
||||
@ -37,7 +37,7 @@ public class ReadyCQLStatementTemplate {
|
||||
private Histogram rowsFetchedHisto;
|
||||
private Writer resultCsvWriter;
|
||||
|
||||
public ReadyCQLStatementTemplate(Map<String,Object> fconfig, CqlBinderTypes binderType, Session session,
|
||||
public ReadyCQLStatementTemplate(Map<String, Object> fconfig, CqlBinderTypes binderType, Session session,
|
||||
PreparedStatement preparedStmt, long ratio, String name) {
|
||||
this.session = session;
|
||||
this.name = name;
|
||||
@ -52,13 +52,13 @@ public class ReadyCQLStatementTemplate {
|
||||
this.ratio = ratio;
|
||||
}
|
||||
|
||||
public ReadyCQLStatementTemplate(Map<String,Object> fconfig, Session session, SimpleStatement simpleStatement, long ratio, String name, boolean parametrized) {
|
||||
public ReadyCQLStatementTemplate(Map<String, Object> fconfig, Session session, SimpleStatement simpleStatement, long ratio, String name, boolean parameterized) {
|
||||
this.session = session;
|
||||
this.name = name;
|
||||
template = new ContextualBindingsArrayTemplate<>(
|
||||
simpleStatement,
|
||||
new BindingsTemplate(fconfig),
|
||||
new SimpleStatementValuesBinder(parametrized)
|
||||
simpleStatement,
|
||||
new BindingsTemplate(fconfig),
|
||||
new SimpleStatementValuesBinder(parameterized)
|
||||
);
|
||||
this.ratio = ratio;
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ public class CqlActivity extends SimpleActivity implements Activity, ActivityDef
|
||||
ParsedStmt parsed = stmtDef.getParsed().orError();
|
||||
|
||||
boolean prepared = stmtDef.getParamOrDefault("prepared", true);
|
||||
boolean parametrized = stmtDef.getParamOrDefault("parametrized", false);
|
||||
boolean parameterized = stmtDef.getParamOrDefault("parameterized", false);
|
||||
long ratio = stmtDef.getParamOrDefault("ratio", 1);
|
||||
|
||||
StringBuilder psummary = new StringBuilder();
|
||||
@ -236,7 +236,7 @@ public class CqlActivity extends SimpleActivity implements Activity, ActivityDef
|
||||
} else {
|
||||
SimpleStatement simpleStatement = SimpleStatement.newInstance(stmtForDriver);
|
||||
template = new ReadyCQLStatementTemplate(fconfig, getSession(), simpleStatement, ratio,
|
||||
parsed.getName(), parametrized);
|
||||
parsed.getName(), parameterized);
|
||||
}
|
||||
|
||||
|
||||
|
@ -8,27 +8,27 @@ import io.nosqlbench.virtdata.core.bindings.ValuesArrayBinder;
|
||||
/**
|
||||
* This binder is not meant to be used with anything but DDL or statements
|
||||
* which should not be trying to parameterize values in general.
|
||||
* Parametrized values are still possible through parametrized constructor parameter.
|
||||
* Parametrized values are still possible through parameterized constructor parameter.
|
||||
* This binder should be avoided in favor of binders returning PreparedStatement
|
||||
*/
|
||||
public class SimpleStatementValuesBinder
|
||||
implements ValuesArrayBinder<SimpleStatement, Statement> {
|
||||
|
||||
private final boolean parametrized;
|
||||
private final boolean parameterized;
|
||||
|
||||
public SimpleStatementValuesBinder(boolean parametrized){
|
||||
this.parametrized = parametrized;
|
||||
public SimpleStatementValuesBinder(boolean parameterized) {
|
||||
this.parameterized = parameterized;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Statement bindValues(SimpleStatement context, Object[] values) {
|
||||
String query = context.getQuery();
|
||||
if(parametrized) {
|
||||
if (parameterized) {
|
||||
String[] splits = query.split("\\?");
|
||||
assert splits.length == values.length+1;
|
||||
assert splits.length == values.length + 1;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(splits[0]);
|
||||
for(int i = 1; i < splits.length; i++) {
|
||||
for (int i = 1; i < splits.length; i++) {
|
||||
sb.append(values[i - 1]);
|
||||
sb.append(splits[i]);
|
||||
}
|
||||
|
@ -26,9 +26,9 @@ public class ReadyCQLStatementTemplate {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(ReadyCQLStatementTemplate.class);
|
||||
private final Session session;
|
||||
private ContextualBindingsArrayTemplate<?, Statement<?>> template;
|
||||
private long ratio;
|
||||
private String name;
|
||||
private final ContextualBindingsArrayTemplate<?, Statement<?>> template;
|
||||
private final long ratio;
|
||||
private final String name;
|
||||
|
||||
private D4ResultSetCycleOperator[] pageInfoCycleOperators;
|
||||
private RowCycleOperator[] rowCycleOperators;
|
||||
@ -60,19 +60,19 @@ public class ReadyCQLStatementTemplate {
|
||||
}
|
||||
|
||||
public ReadyCQLStatementTemplate(
|
||||
Map<String,Object> fconfig,
|
||||
Session session,
|
||||
SimpleStatement simpleStatement,
|
||||
long ratio,
|
||||
String name,
|
||||
boolean parametrized
|
||||
Map<String,Object> fconfig,
|
||||
Session session,
|
||||
SimpleStatement simpleStatement,
|
||||
long ratio,
|
||||
String name,
|
||||
boolean parameterized
|
||||
) {
|
||||
this.session = session;
|
||||
this.name = name;
|
||||
template = new ContextualBindingsArrayTemplate(
|
||||
simpleStatement,
|
||||
new BindingsTemplate(fconfig),
|
||||
new SimpleStatementValuesBinder(parametrized)
|
||||
new SimpleStatementValuesBinder(parameterized)
|
||||
);
|
||||
this.ratio = ratio;
|
||||
}
|
||||
|
@ -21,7 +21,8 @@ public class Synonyms {
|
||||
put("hosts",Set.of("host"));
|
||||
put("workload",Set.of("yaml"));
|
||||
put("driver",Set.of("type"));
|
||||
put("cyclerate",Set.of("targetrate","rate"));
|
||||
put("cyclerate", Set.of("targetrate", "rate"));
|
||||
put("parameterized", Set.of("parametrized")); // mispelling safety net
|
||||
}};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user