Class BaseDriverAdapter<R extends Op,​S>

java.lang.Object
io.nosqlbench.engine.api.activityimpl.uniform.BaseDriverAdapter<R,​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
    protected BaseDriverAdapter()  
  • Method Summary

    Modifier and Type Method Description
    void applyConfig​(io.nosqlbench.nb.api.config.standard.NBConfiguration cfg)  
    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.
    io.nosqlbench.nb.api.config.standard.NBConfiguration getConfiguration()  
    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 from getOpStmtRemappers() and getOpFieldRemappers() 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, wait

    Methods 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 from getOpStmtRemappers() and getOpFieldRemappers() and construct a preprocessor list. These are applied successively to the op template fields so long as remapping occurs.
      Specified by:
      getPreprocessor in interface DriverAdapter<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

      public final DriverSpaceCache<? extends S> getSpaceCache()
      Description copied from interface: DriverAdapter
      The 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. See DriverSpaceCache for 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:
      getSpaceCache in interface DriverAdapter<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:
      getConfigModel in interface io.nosqlbench.nb.api.config.standard.NBConfigModelProvider
      Specified by:
      getConfigModel in interface io.nosqlbench.nb.api.config.standard.NBConfigurable
    • getConfiguration

      public io.nosqlbench.nb.api.config.standard.NBConfiguration getConfiguration()
      Specified by:
      getConfiguration in interface DriverAdapter<R extends Op,​S>
    • applyConfig

      public void applyConfig​(io.nosqlbench.nb.api.config.standard.NBConfiguration cfg)
      Specified by:
      applyConfig in interface io.nosqlbench.nb.api.config.standard.NBCanConfigure
      Specified by:
      applyConfig in interface io.nosqlbench.nb.api.config.standard.NBConfigurable