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.NBConfigModelProvider,io.nosqlbench.nb.api.config.standard.NBConfigurable
public abstract class BaseDriverAdapter<R extends Op,S> extends java.lang.Object implements DriverAdapter<R,S>, io.nosqlbench.nb.api.config.standard.NBConfigurable
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseDriverAdapter() -
Method Summary
Modifier and Type Method Description voidapplyConfig(io.nosqlbench.nb.api.config.standard.NBConfiguration cfg)io.nosqlbench.nb.api.config.standard.NBConfigModelgetConfigModel()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.io.nosqlbench.nb.api.config.standard.NBConfigurationgetConfiguration()java.util.List<java.util.function.Function<java.util.Map<java.lang.String,java.lang.Object>,java.util.Map<java.lang.String,java.lang.Object>>>getOpFieldRemappers()Provide a list of field remappers which operate on arbitrary fields.java.util.List<java.util.function.Function<java.lang.String,java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>>>>getOpStmtRemappers()Provide a list of field remappers which operate exclusively on the 'stmt' field in the op template.java.util.function.Function<java.util.Map<java.lang.String,java.lang.Object>,java.util.Map<java.lang.String,java.lang.Object>>getPreprocessor()BaseDriverAdapter will take any provided functions fromgetOpStmtRemappers()andgetOpFieldRemappers()and construct a preprocessor list.DriverSpaceCache<? extends S>getSpaceCache()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
getErrorNameMapper, getOpMapper, getSpaceInitializer
-
Constructor Details
-
BaseDriverAdapter
protected BaseDriverAdapter()
-
-
Method Details
-
getPreprocessor
public final java.util.function.Function<java.util.Map<java.lang.String,java.lang.Object>,java.util.Map<java.lang.String,java.lang.Object>> 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
public java.util.List<java.util.function.Function<java.lang.String,java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>>>> 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 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.
- Returns:
- A list of optionally applied remapping functions.
-
getOpFieldRemappers
public java.util.List<java.util.function.Function<java.util.Map<java.lang.String,java.lang.Object>,java.util.Map<java.lang.String,java.lang.Object>>> getOpFieldRemappers()Provide a list of field remappers which operate on arbitrary fields. Each function is applied to the op template fields.
- 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
-
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
-
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
-