Class SimpleActivity
java.lang.Object
io.nosqlbench.nb.api.components.core.NBBaseComponentMetrics
io.nosqlbench.nb.api.components.core.NBBaseComponent
io.nosqlbench.nb.api.components.status.NBStatusComponent
io.nosqlbench.engine.api.activityimpl.SimpleActivity
- All Implemented Interfaces:
Activity,ActivityDefObserver,ProgressCapable,StateCapable,InvokableResult,NBComponent,NBComponentAdvisors,NBComponentEvents,NBComponentMetrics,NBComponentProps,NBComponentServices,NBComponentTimeline,NBProviderSearch,NBTokenWords,NBLabeledElement,AutoCloseable,Comparable<Activity>
- Direct Known Subclasses:
StandardActivity
A default implementation of an Activity, suitable for building upon.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.nosqlbench.nb.api.labels.NBLabeledElement
NBLabeledElement.BasicLabeledElement -
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionSimpleActivity(NBComponent parent, ActivityDef activityDef) SimpleActivity(NBComponent parent, String activityDefString) -
Method Summary
Modifier and TypeMethodDescriptionasResult()voidClose all autocloseables that have been registered with this Activity.intprotected <O> OpSequence<OpDispenser<? extends O>> createOpSequence(Function<OpTemplate, OpDispenser<? extends O>> opinit, boolean strict, DriverAdapter<?, ?> defaultAdapter) Deprecated, for removal: This API element is subject to removal in a future version.protected <O extends LongFunction>
OpSequence<OpDispenser<? extends CycleOp<?>>> createOpSourceFromParsedOps(List<DriverAdapter<CycleOp<?>, Space>> adapters, List<ParsedOp> pops) voidvoidfinal ActionDispenserGet the current cycle rate limiter for this activity.final InputDispenserGet or create the instrumentation needed for this activity.intActivities with retryable operations (when specified with the retry error handler for some types of error), should allow the user to specify how many retries are allowed before giving up on the operation.final MotorDispenser<?> longGet the current stride rate limiter for this activity.voidvoidinitOrUpdateRateLimiters(ActivityDef activityDef) protected List<OpTemplate> loadOpTemplates(DriverAdapter<?, ?> defaultDriverAdapter) protected OpsDocListvoidonActivityDefUpdate(ActivityDef activityDef) voidregisterAutoCloseable(AutoCloseable closeable) Register an object which should be closed after this activity is shutdown.final voidsetActionDispenserDelegate(ActionDispenser actionDispenser) voidsetConsoleOut(PrintWriter writer) voidsetDefaultsFromOpSequence(OpSequence<?> seq) Modify the provided ActivityDef with defaults for stride and cycles, if they haven't been provided, based on the length of the sequence as determined by the provided ratios.final voidsetInputDispenserDelegate(InputDispenser inputDispenser) final voidsetMotorDispenserDelegate(MotorDispenser<?> motorDispenser) voidsetOutputDispenserDelegate(OutputDispenser outputDispenser) voidsetResultFilterDispenserDelegate(IntPredicateDispenser resultFilterDispenser) voidsetRunState(RunState runState) toString()Methods inherited from class io.nosqlbench.nb.api.components.status.NBStatusComponent
session_time_ms, statusMethods 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, teardownMethods 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.engine.api.activityapi.core.Activity
getAlias, getCycleSummary, getHdrDigits, getParams, shutdownActivityMethods inherited from interface io.nosqlbench.nb.api.components.core.NBComponent
attachChild, beforeDetach, 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
-
Field Details
-
activityDef
-
-
Constructor Details
-
SimpleActivity
-
SimpleActivity
-
-
Method Details
-
initActivity
public void initActivity()- Specified by:
initActivityin interfaceActivity
-
getErrorHandler
-
getRunState
- Specified by:
getRunStatein interfaceActivity- Specified by:
getRunStatein interfaceStateCapable
-
setRunState
- Specified by:
setRunStatein interfaceActivity
-
getStartedAtMillis
public long getStartedAtMillis()- Specified by:
getStartedAtMillisin interfaceActivity
-
getMotorDispenserDelegate
- Specified by:
getMotorDispenserDelegatein interfaceActivity
-
setMotorDispenserDelegate
- Specified by:
setMotorDispenserDelegatein interfaceActivity
-
getInputDispenserDelegate
- Specified by:
getInputDispenserDelegatein interfaceActivity
-
setInputDispenserDelegate
- Specified by:
setInputDispenserDelegatein interfaceActivity
-
getActionDispenserDelegate
- Specified by:
getActionDispenserDelegatein interfaceActivity
-
setActionDispenserDelegate
- Specified by:
setActionDispenserDelegatein interfaceActivity
-
getResultFilterDispenserDelegate
- Specified by:
getResultFilterDispenserDelegatein interfaceActivity
-
setResultFilterDispenserDelegate
- Specified by:
setResultFilterDispenserDelegatein interfaceActivity
-
getMarkerDispenserDelegate
- Specified by:
getMarkerDispenserDelegatein interfaceActivity
-
setOutputDispenserDelegate
- Specified by:
setOutputDispenserDelegatein interfaceActivity
-
getActivityDef
- Specified by:
getActivityDefin interfaceActivity
-
toString
- Overrides:
toStringin classNBBaseComponent
-
compareTo
- Specified by:
compareToin interfaceComparable<Activity>
-
registerAutoCloseable
Description copied from interface:ActivityRegister an object which should be closed after this activity is shutdown.- Specified by:
registerAutoCloseablein interfaceActivity- Parameters:
closeable- An Autocloseable object
-
closeAutoCloseables
public void closeAutoCloseables()Description copied from interface:ActivityClose all autocloseables that have been registered with this Activity.- Specified by:
closeAutoCloseablesin interfaceActivity
-
getCycleLimiter
Description copied from interface:ActivityGet the current cycle rate limiter for this activity. The cycle rate limiter is used to throttle the rate at which cycles are dispatched across all threads in the activity- Specified by:
getCycleLimiterin interfaceActivity- Returns:
- the cycle
RateLimiter
-
getStrideLimiter
Description copied from interface:ActivityGet the current stride rate limiter for this activity. The stride rate limiter is used to throttle the rate at which new strides are dispatched across all threads in an activity.- Specified by:
getStrideLimiterin interfaceActivity- Returns:
- The stride
RateLimiter
-
getInstrumentation
Description copied from interface:ActivityGet or create the instrumentation needed for this activity. This provides a single place to find and manage, and document instrumentation that is uniform across all activities.- Specified by:
getInstrumentationin interfaceActivity- Returns:
- A new or existing instrumentation object for this activity.
-
getConsoleOut
- Specified by:
getConsoleOutin interfaceActivity
-
getConsoleIn
- Specified by:
getConsoleInin interfaceActivity
-
setConsoleOut
- Specified by:
setConsoleOutin interfaceActivity
-
getExceptionMetrics
- Specified by:
getExceptionMetricsin interfaceActivity
-
onActivityDefUpdate
- Specified by:
onActivityDefUpdatein interfaceActivityDefObserver
-
initOrUpdateRateLimiters
-
createOrUpdateStrideLimiter
-
createOrUpdateCycleLimiter
-
setDefaultsFromOpSequence
Modify the provided ActivityDef with defaults for stride and cycles, if they haven't been provided, based on the length of the sequence as determined by the provided ratios. Also, modify the ActivityDef with reasonable defaults when requested.- Parameters:
seq- - TheOpSequenceto derive the defaults from
-
createOpSourceFromParsedOps
protected <O extends LongFunction> OpSequence<OpDispenser<? extends CycleOp<?>>> createOpSourceFromParsedOps(List<DriverAdapter<CycleOp<?>, Space>> adapters, List<ParsedOp> pops) -
loadOpTemplates
-
createOpSequence
@Deprecated(forRemoval=true) protected <O> OpSequence<OpDispenser<? extends O>> createOpSequence(Function<OpTemplate, OpDispenser<? extends O>> opinit, boolean strict, DriverAdapter<?, ?> defaultAdapter) Deprecated, for removal: This API element is subject to removal in a future version.Given a function that can create an op of typefrom an OpTemplate, generate an indexed sequence of ready to call operations. This method uses the following conventions to derive the sequence:
- If an 'op', 'stmt', or 'statement' parameter is provided, then it's value is taken as the only provided statement.
- If a 'yaml, or 'workload' parameter is provided, then the statements in that file are taken with their ratios
- Any provided tags filter is used to select only the op templates which have matching tags. If no tags are provided, then all the found op templates are included.
- The ratios and the 'seq' parameter are used to build a sequence of the ready operations, where the sequence length is the sum of the ratios.
- Type Parameters:
O- A holder for an executable operation for the native driver used by this activity.- Parameters:
opinit- A function to map an OpTemplate to the executable operation form required by the native driver for this activity.defaultAdapter- The adapter which will be used for any op templates with no explicit adapter- Returns:
- The sequence of operations as determined by filtering and ratios
-
loadStmtsDocList
-
getProgressMeter
- Specified by:
getProgressMeterin interfaceProgressCapable
-
getMaxTries
public int getMaxTries()Activities with retryable operations (when specified with the retry error handler for some types of error), should allow the user to specify how many retries are allowed before giving up on the operation.- Specified by:
getMaxTriesin interfaceActivity- Returns:
- The number of allowable retries
-
getRunStateTally
- Specified by:
getRunStateTallyin interfaceActivity
-
asResult
- Specified by:
asResultin interfaceInvokableResult
-