Class StringDriverSpaceCache<S>
- Type Parameters:
S- The type which will represent the cache for a given type of adapter.
- All Implemented Interfaces:
NBComponent,NBComponentAdvisors,NBComponentEvents,NBComponentMetrics,NBComponentProps,NBComponentServices,NBComponentTimeline,NBProviderSearch,NBTokenWords,NBLabeledElement,AutoCloseable
A DriverSpaceCache is simply a place to hold something like a
client instance and all associated objects for quick and easy access. Each
space cache is simply a named and separate cache of objects. This is provided
as a convenient way to keep object state around which may be needed during the
course of executing operations with a driver or API. By naming each space, it
becomes possible for tests to create and use separate logical instances of
a client API for advanced testing. The default instance should simply be named
default
Most native drivers use some combination of fluent, functional, and declarative patterns. These usually require you to keep access to a set of core state-holding objects in order to construct new elements to drive operations with. An example of this would be creating an executable operation from a session object. It is necessary to keep the session around in for when you create new statements. Maintaining the session object is considered an essential part of idiomatic and efficient use of the API. Further, you may have builders or factories that are created from the session which should be cached as well. Keeping all these objects together requires attaching them to a cohesive owning object -- That is the space cache.
-
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
ConstructorsConstructorDescriptionStringDriverSpaceCache(NBComponent parent, Function<String, S> newSpaceFunction) -
Method Summary
Methods inherited from class io.nosqlbench.nb.api.components.core.NBBaseComponent
addAdvisor, addMetricsCloseable, attachChild, beforeDetach, 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.nb.api.components.core.NBComponentAdvisors
getAdvisorResultsMethods inherited from interface io.nosqlbench.nb.api.components.core.NBComponentMetrics
addComponentMetric, findComponentMetrics, findComponentMetrics, findOneComponentMetric, findOneComponentMetric, getComponentMetric, getComponentMetricsMethods inherited from interface io.nosqlbench.nb.api.labels.NBLabeledElement
description
-
Constructor Details
-
StringDriverSpaceCache
-
-
Method Details
-
get
-
getElements
-