Class BaseDriverAdapter<R extends Op,S>
- All Implemented Interfaces:
DriverAdapter<R,,S> io.nosqlbench.nb.api.config.standard.NBCanConfigure,io.nosqlbench.nb.api.config.standard.NBCanReconfigure,io.nosqlbench.nb.api.config.standard.NBConfigModelProvider,io.nosqlbench.nb.api.config.standard.NBConfigurable,io.nosqlbench.nb.api.config.standard.NBReconfigModelProvider,io.nosqlbench.nb.api.config.standard.NBReconfigurable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyConfig(io.nosqlbench.nb.api.config.standard.NBConfiguration cfg) voidapplyReconfig(io.nosqlbench.nb.api.config.standard.NBConfiguration reconf) io.nosqlbench.nb.api.config.standard.NBConfigModelIn order to be provided with config information, it is required that the driver adapter specify the valid configuration options, their types, and so on.io.nosqlbench.nb.api.config.standard.NBConfigurationProvide a list of field remappers which operate on arbitrary fields.Provide a list of field remappers which operate exclusively on the 'stmt' field in the op template.BaseDriverAdapter will take any provided functions fromgetOpStmtRemappers()andgetOpFieldRemappers()and construct a preprocessor list.io.nosqlbench.nb.api.config.standard.NBConfigModelfinal DriverSpaceCache<? extends S>The cache of all objects needed within a single instance of a DriverAdapter which are not operations.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.nosqlbench.engine.api.activityimpl.uniform.DriverAdapter
getAdapterMaturity, getAdapterName, getBundledDocs, getErrorNameMapper, getOpMapper, getSpaceInitializer
-
Constructor Details
-
BaseDriverAdapter
public BaseDriverAdapter()
-
-
Method Details
-
getPreprocessor
BaseDriverAdapter will take any provided functions fromgetOpStmtRemappers()andgetOpFieldRemappers()and construct a preprocessor list. These are applied successively to the op template fields so long as remapping occurs.- Specified by:
getPreprocessorin interfaceDriverAdapter<R extends Op,S> - Returns:
- a list of preprocessors for op template fields
-
getOpStmtRemappers
Provide a list of field remappers which operate exclusively on the 'stmt' field in the op template. These are useful, for example, for taking the 'stmt' field and parsing it into component fields which might otherwise be specified by the user. This allows users to specify String-form op templates which are automatically parsed and destructured into the canonical field-wise form for a given type of operation.
Each function in this list is applied in order. If the function returns a value, then the 'stmt' field is removed and the resulting map is added to the other fields in the op template.
If a driver adapter is meant to support the
stmtfield, then this must be provided. The use of the stmt field should be documented in the driver adapter user docs with examples for any supported formats. A default implementation does nothing, as it must be decided per-driver whether or not the stmt field will be used directly or whether it is short-hand for a more canonical form.
If you want to automatically destructure stmt values into a map and inject its entries into the op template fields, simply provide an implementation like this:
return List.of(stmt -> Optional.of(NBParams.one(stmt).getMap()));- Returns:
- A list of optionally applied remapping functions.
-
getOpFieldRemappers
Provide a list of field remappers which operate on arbitrary fields. Each function is applied to the op template fields.
- Specified by:
getOpFieldRemappersin interfaceDriverAdapter<R extends Op,S> - Returns:
-
getSpaceCache
Description copied from interface:DriverAdapterThe cache of all objects needed within a single instance of a DriverAdapter which are not operations. These are generally things needed by operations, or things needed during the construction of operations. SeeDriverSpaceCachefor details on when and how to use this function.During Adapter Initialization, Op Mapping, Op Synthesis, or Op Execution, you may need access to the objects in (the or a) space cache. You can build the type of context needed and then provide this function to provide new instances when needed.
- Specified by:
getSpaceCachein interfaceDriverAdapter<R extends Op,S> - Returns:
- A cache of named objects
-
getConfiguration
public io.nosqlbench.nb.api.config.standard.NBConfiguration getConfiguration()- Specified by:
getConfigurationin interfaceDriverAdapter<R extends Op,S>
-
applyConfig
public void applyConfig(io.nosqlbench.nb.api.config.standard.NBConfiguration cfg) - Specified by:
applyConfigin interfaceio.nosqlbench.nb.api.config.standard.NBCanConfigure- Specified by:
applyConfigin interfaceio.nosqlbench.nb.api.config.standard.NBConfigurable
-
applyReconfig
public void applyReconfig(io.nosqlbench.nb.api.config.standard.NBConfiguration reconf) - Specified by:
applyReconfigin interfaceio.nosqlbench.nb.api.config.standard.NBCanReconfigure- Specified by:
applyReconfigin interfaceio.nosqlbench.nb.api.config.standard.NBReconfigurable
-
getConfigModel
public io.nosqlbench.nb.api.config.standard.NBConfigModel getConfigModel()In order to be provided with config information, it is required that the driver adapter specify the valid configuration options, their types, and so on.- Specified by:
getConfigModelin interfaceio.nosqlbench.nb.api.config.standard.NBConfigModelProvider- Specified by:
getConfigModelin interfaceio.nosqlbench.nb.api.config.standard.NBConfigurable
-
getReconfigModel
public io.nosqlbench.nb.api.config.standard.NBConfigModel getReconfigModel()- Specified by:
getReconfigModelin interfaceio.nosqlbench.nb.api.config.standard.NBReconfigModelProvider- Specified by:
getReconfigModelin interfaceio.nosqlbench.nb.api.config.standard.NBReconfigurable
-