- All Implemented Interfaces:
DriverAdapter<RESULT,,SPACE> NBComponent,NBComponentAdvisors,NBComponentEvents,NBComponentMetrics,NBComponentProps,NBComponentServices,NBComponentTimeline,NBProviderSearch,NBTokenWords,NBCanConfigure,NBCanReconfigure,NBConfigModelProvider,NBConfigurable,NBReconfigModelProvider,NBReconfigurable,NBLabeledElement,AutoCloseable
- Direct Known Subclasses:
AmqpDriverAdapter,AzureAISearchDriverAdapter,Cqld4DriverAdapter,DataApiDriverAdapter,DiagDriverAdapter,DynamoDBDriverAdapter,ExampleDriverAdapter,GCPSpannerDriverAdapter,HttpDriverAdapter,KafkaDriverAdapter,MongodbDriverAdapter,Neo4JDriverAdapter,PulsarDriverAdapter,QdrantDriverAdapter,S4JDriverAdapter,StdoutDriverAdapter,TcpClientDriverAdapter,TcpServerDriverAdapter,WeaviateDriverAdapter
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.nosqlbench.nb.api.labels.NBLabeledElement
NBLabeledElement.BasicLabeledElement -
Field Summary
Fields inherited from class io.nosqlbench.nb.api.components.core.NBBaseComponent
bufferOrphanedMetrics, closed_ns, error, errored_ns, labels, metricsBuffer, parent, started_epoch_ms, started_ns, state, teardown_nsFields inherited from interface io.nosqlbench.nb.api.components.core.NBComponent
EMPTY_COMPONENTFields inherited from interface io.nosqlbench.nb.api.components.core.NBComponentProps
HDRDIGITS, SUMMARYFields inherited from interface io.nosqlbench.nb.api.labels.NBLabeledElement
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidImplementors should take care to ensure that this can be called after initial construction without unexpected interactions between construction parameters and configuration parameters.voidapplyReconfig(NBConfiguration reconf) This applies a configuration to an element AFTER the initial configuration fromNBConfigurable.voidIn order to be provided with config information, it is required that the driver adapter specify the valid configuration options, their types, and so on.Provides the configuration for this driver adapter, which comes from the superset of activity parameters given for the owning activity.Provide 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.Implement this method by returning an instance ofConfigModel.getSpaceFunc(ParsedOp pop) The function returned byDriverAdapter.getSpaceFunc(ParsedOp)provides access to a cache of all stateful objects needed within a single instance of a DriverAdapter.Methods inherited from class io.nosqlbench.nb.api.components.core.NBBaseComponent
addAdvisor, addMetricsCloseable, attachChild, close, create, detachChild, find, findParentService, getAdvisors, getChildren, getComponentOnlyLabels, getComponentProp, getComponentState, getLabels, getNanosSinceStart, getParent, getTokens, nanosof_close, nanosof_error, nanosof_start, nanosof_teardown, onError, onEvent, reportExecutionMetric, setComponentProp, started_epoch_ms, teardown, toStringMethods inherited from class io.nosqlbench.nb.api.components.core.NBBaseComponentMetrics
addComponentMetric, addListener, findComponentMetrics, findComponentMetrics, getComponentMetric, getComponentMetrics, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.nosqlbench.adapters.api.activityimpl.uniform.DriverAdapter
getAdapterMaturity, getAdapterName, getBundledDocs, getErrorNameMapper, getOpMapper, getSpaceInitializerMethods inherited from interface io.nosqlbench.nb.api.components.core.NBComponent
attachChild, close, detachChild, getChildren, getComponentOnlyLabels, getNanosSinceStart, getParent, reportExecutionMetricMethods inherited from interface io.nosqlbench.nb.api.components.core.NBComponentAdvisors
addAdvisor, getAdvisorResults, getAdvisorsMethods inherited from interface io.nosqlbench.nb.api.components.core.NBComponentEvents
onEventMethods inherited from interface io.nosqlbench.nb.api.components.core.NBComponentMetrics
addComponentMetric, findComponentMetrics, findComponentMetrics, findOneComponentMetric, findOneComponentMetric, getComponentMetric, getComponentMetricsMethods inherited from interface io.nosqlbench.nb.api.components.core.NBComponentProps
getComponentProp, setComponentPropMethods inherited from interface io.nosqlbench.nb.api.components.core.NBComponentServices
create, findMethods inherited from interface io.nosqlbench.nb.api.labels.NBLabeledElement
description, getLabelsMethods inherited from interface io.nosqlbench.nb.api.components.decorators.NBProviderSearch
findParentService
-
Constructor Details
-
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<RESULT extends CycleOp<?>,SPACE extends Space> - 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<RESULT extends CycleOp<?>,SPACE extends Space> - Returns:
- op field remappers, an empty list by default
-
getConfiguration
Description copied from interface:DriverAdapterProvides the configuration for this driver adapter, which comes from the superset of activity parameters given for the owning activity. Presently, the driver adapter acts as a proxy to set these parameters on the space, but this will likely be updated. Instead, the configuratin will be properly attached to the space directly, and the APIs supporting it will enforce this.- Specified by:
getConfigurationin interfaceDriverAdapter<RESULT extends CycleOp<?>,SPACE extends Space>
-
applyConfig
Description copied from interface:NBConfigurableImplementors should take care to ensure that this can be called after initial construction without unexpected interactions between construction parameters and configuration parameters.- Specified by:
applyConfigin interfaceNBCanConfigure- Specified by:
applyConfigin interfaceNBConfigurable- Parameters:
cfg- The configuration data to be applied to a new instance
-
applyReconfig
Description copied from interface:NBReconfigurableThis applies a configuration to an element AFTER the initial configuration fromNBConfigurable.- Specified by:
applyReconfigin interfaceNBCanReconfigure- Specified by:
applyReconfigin interfaceNBReconfigurable- Parameters:
reconf- The configuration data to be applied to a new instance
-
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 interfaceNBConfigModelProvider- Specified by:
getConfigModelin interfaceNBConfigurable- Returns:
- A valid configuration model for the implementing class
-
getReconfigModel
Description copied from interface:NBReconfigurableImplement this method by returning an instance ofConfigModel. Any configuration which is provided to theNBReconfigurable.applyReconfig(NBConfiguration)method will be validated through this model. A configuration model is required in order to build a validated configuration from source data provided by a user.- Specified by:
getReconfigModelin interfaceNBReconfigModelProvider- Specified by:
getReconfigModelin interfaceNBReconfigurable- Returns:
- A valid configuration model for the implementing class
-
getSpaceFunc
Description copied from interface:DriverAdapterThe function returned by
DriverAdapter.getSpaceFunc(ParsedOp)provides access to a cache of all stateful objects needed within a single instance of a DriverAdapter. These are generally things needed by operations, or things needed during the construction of operations. Typically, a space is where you store a native driver instance which is expected to be created/initialized once and reused within an application. Generally, users can think of space as driver instance, or client instance, although there are driver adapters that do things other than wrap native drivers and clients.The value of the op field
spaceis used to customize the instancing behavior of spaces. If none is provided by the user, then only a singular space will be created for a given adapter in an activity. This is normal, and what most users will expect to do. However, customizing the space selector can be a powerful way to test any system with high logical concurrency. For example, each instance of a native driver will typically maintain its own thread or connection pools, cached resources and so on. ( Unless the developers of said native driver are breaking encapsulation by using global singletons in the runtime, which is highly frowned upon.) The spaces feature allows any nosqlbench workload to be easily converted into an unreasonably parallel client topology test with a single change. It works the same way for any adapter or protocol supported by nosqlbench.The value of the op field
spaceshould be aNumbertype.Number.intValue()is used to determine which space instance is, if needed, initialized first, and then returned. If users provide a non-Numbertype, then an enumerating layer is added inline to convert any such value to an integer, which is less optimal.During op mapping or dispensing, you may need access to state held by a driver-specific implementation of
DriverAdapter. In the initialization phase, you only have access to the space function itself. This is important to maintain a boundary betwen the explicitly stateless and stateful parts of the runtime. To use the space, incorporate the space function into the lambdas which produce the operation to be executed. This is typically done in the construtor of the relatedOpDispenser.- Specified by:
getSpaceFuncin interfaceDriverAdapter<RESULT extends CycleOp<?>,SPACE extends Space> - Returns:
- A cache of named objects
-
beforeDetach
public void beforeDetach()- Specified by:
beforeDetachin interfaceNBComponent- Overrides:
beforeDetachin classNBBaseComponent
-