mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
clarify naming of statement fields
This commit is contained in:
parent
a0dc30a675
commit
b3eecb4d65
@ -21,7 +21,7 @@ import java.util.Iterator;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
public class RawStmtDef extends BlockParams {
|
public class RawStmtDef extends RawStmtFields {
|
||||||
|
|
||||||
private String statement;
|
private String statement;
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ public class RawStmtDef extends BlockParams {
|
|||||||
setName(defaultName);
|
setName(defaultName);
|
||||||
}
|
}
|
||||||
|
|
||||||
map.forEach((key, value) -> getParams().put(key, String.valueOf(value)));
|
map.forEach((key, value) -> getParams().put(key, value));
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getStmt() {
|
public String getStmt() {
|
||||||
|
@ -18,18 +18,17 @@
|
|||||||
package io.nosqlbench.engine.api.activityconfig.rawyaml;
|
package io.nosqlbench.engine.api.activityconfig.rawyaml;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class BlockParams extends Tags {
|
public class RawStmtFields extends Tags {
|
||||||
|
|
||||||
private String name = "";
|
private String name = "";
|
||||||
private String desc = "";
|
private String desc = "";
|
||||||
private final Map<String, String> bindings = new LinkedHashMap<>();
|
private final Map<String, String> bindings = new LinkedHashMap<>();
|
||||||
private final Map<String, Object> params = new LinkedHashMap<>();
|
private final Map<String, Object> params = new LinkedHashMap<>();
|
||||||
|
|
||||||
public BlockParams() {
|
public RawStmtFields() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDesc() {
|
public String getDesc() {
|
||||||
@ -76,7 +75,7 @@ public class BlockParams extends Tags {
|
|||||||
this.params.putAll(config);
|
this.params.putAll(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void applyBlockParams(BlockParams other) {
|
public void applyBlockParams(RawStmtFields other) {
|
||||||
setName(other.getName());
|
setName(other.getName());
|
||||||
setBindings(other.getBindings());
|
setBindings(other.getBindings());
|
||||||
setTags(other.getTags());
|
setTags(other.getTags());
|
||||||
@ -110,7 +109,13 @@ public class BlockParams extends Tags {
|
|||||||
if (paramsObject!=null) {
|
if (paramsObject!=null) {
|
||||||
if (paramsObject instanceof Map) {
|
if (paramsObject instanceof Map) {
|
||||||
Map<Object,Object> paramsMap = (Map<Object,Object>) paramsObject;
|
Map<Object,Object> paramsMap = (Map<Object,Object>) paramsObject;
|
||||||
paramsMap.forEach((ko,vo) -> params.put(ko.toString(),vo));
|
paramsMap.forEach(
|
||||||
|
(ko,vo) -> {
|
||||||
|
String paramkey = ko.toString();
|
||||||
|
Object paramVal = vo;
|
||||||
|
params.put(paramkey, paramVal);
|
||||||
|
}
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("Invalid type for params object:" + paramsObject.getClass().getCanonicalName());
|
throw new RuntimeException("Invalid type for params object:" + paramsObject.getClass().getCanonicalName());
|
||||||
}
|
}
|
@ -17,12 +17,11 @@
|
|||||||
|
|
||||||
package io.nosqlbench.engine.api.activityconfig.rawyaml;
|
package io.nosqlbench.engine.api.activityconfig.rawyaml;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A StmtsDef contains a list of rawStmts, as well as all of the optional
|
* A StmtsDef contains a list of rawStmts, as well as all of the optional
|
||||||
* block parameters that can be assigned to {@link BlockParams}, which includes
|
* block parameters that can be assigned to {@link RawStmtFields}, which includes
|
||||||
* a name, config values, data bindings, and filtering tags.
|
* a name, config values, data bindings, and filtering tags.
|
||||||
*/
|
*/
|
||||||
public class RawStmtsBlock extends StatementsOwner {
|
public class RawStmtsBlock extends StatementsOwner {
|
||||||
|
@ -20,12 +20,11 @@ package io.nosqlbench.engine.api.activityconfig.rawyaml;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A statements doc can have both a list of statement blocks and/or a
|
* A statements doc can have both a list of statement blocks and/or a
|
||||||
* list of statements. It can also have all the block parameters
|
* list of statements. It can also have all the block parameters
|
||||||
* assignable to {@link BlockParams}.
|
* assignable to {@link RawStmtFields}.
|
||||||
* <p>
|
* <p>
|
||||||
* The reason for having support both statements or statement blocks
|
* The reason for having support both statements or statement blocks
|
||||||
* is merely convenience. If you do not need or want to deal with the
|
* is merely convenience. If you do not need or want to deal with the
|
||||||
|
Loading…
Reference in New Issue
Block a user