Class OpTemplate
java.lang.Object
io.nosqlbench.adapters.api.activityconfig.yaml.OpTemplate
- All Implemented Interfaces:
OpTemplateProps,Tagged
The OpTemplate is a structurally normalized type which presents the user-provided op template to the NoSQLBench
loading and templating mechanisms. This type is not generally used directly for new driver development. It is the
backing data which is used by ParsedOp, which is used in drivers to map
op templates to function to be used for a given cycle value.
This is part of the implementation of the NoSQLBench Uniform Workload Specification. Check the tests for UniformWorkloadSpecification directly to see how this specification is tested and documented.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasData()voidgetOptionalStringParam(String name) <V> Optional<V> getOptionalStringParam(String name, Class<? extends V> type) <V> V<V> VgetParamOrDefault(String name, V defaultValue) getParamsAsValueType(Class<? extends T> type) Parse the statement for anchors and return a richer view of the StmtDef which is simpler to use for most statement configuration needs.getStmt()Legacy support for String form statements.getTags()Return a map of tags for this statement.<V> VremoveParamOrDefault(String name, V defaultValue) intsize()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.nosqlbench.adapters.api.activityconfig.yaml.OpTemplateProps
getBindings, getDesc, getName, getOp, getParams, getRefKey
-
Field Details
-
FIELD_DESC
- See Also:
-
FIELD_NAME
- See Also:
-
FIELD_OP
- See Also:
-
FIELD_BINDINGS
- See Also:
-
FIELD_PARAMS
- See Also:
-
FIELD_TAGS
- See Also:
-
FIELD_REFKEY
- See Also:
-
-
Constructor Details
-
OpTemplate
public OpTemplate()
-
-
Method Details
-
getTags
Return a map of tags for this statement. Implementations are required to add a tag for "name" automatically when this value is set during construction.- Specified by:
getTagsin interfaceOpTemplateProps- Specified by:
getTagsin interfaceTagged- Returns:
- A map of assigned tags for the op, with the name added as an auto-tag.
-
getParamsAsValueType
-
removeParamOrDefault
-
getParamOrDefault
-
getParam
-
getOptionalStringParam
-
getOptionalStringParam
-
getParsed
Parse the statement for anchors and return a richer view of the StmtDef which is simpler to use for most statement configuration needs.- Returns:
- an optional
ParsedTemplateString
-
getParsed
-
asData
-
getStmt
Legacy support for String form statements. This is left here as a convenience method, however it is changed to an Optional to force caller refactorings.- Specified by:
getStmtin interfaceOpTemplateProps- Returns:
- An optional string version of the op, empty if there is no 'stmt' property in the op fields, or no op fields at all.
-
getParamReader
-
size
public int size()- Returns:
- the size of remaining fields from the op template and the params map.
-
remainingFields
-
assertConsumed
public void assertConsumed()
-