Class UnstartedPeriodicTaskComponent
java.lang.Object
io.nosqlbench.nb.api.components.core.NBBaseComponentMetrics
io.nosqlbench.nb.api.components.core.NBBaseComponent
io.nosqlbench.nb.api.components.core.UnstartedPeriodicTaskComponent
- All Implemented Interfaces:
NBComponent,NBComponentAdvisors,NBComponentEvents,NBComponentMetrics,NBComponentProps,NBComponentServices,NBComponentTimeline,NBProviderSearch,NBTokenWords,NBLabeledElement,AutoCloseable,Runnable
- Direct Known Subclasses:
ComponentPulse,PeriodicTaskComponent
Because of ctor super calling order requirements, the task thread can't always be started automatically in super(...). If that is the case, then use this class directly and call start() at the end of your subtype ctor.
Otherwise, it is safe to use PeriodicTaskComponent directly.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumNested 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
ConstructorsConstructorDescriptionUnstartedPeriodicTaskComponent(NBComponent node, NBLabels extraLabels, long millis, String threadName, UnstartedPeriodicTaskComponent.FirstReport firstReport, UnstartedPeriodicTaskComponent.LastReport lastReport) -
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, 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
-
Field Details
-
intervalmillis
protected final long intervalmillis
-
-
Constructor Details
-
UnstartedPeriodicTaskComponent
public UnstartedPeriodicTaskComponent(NBComponent node, NBLabels extraLabels, long millis, String threadName, UnstartedPeriodicTaskComponent.FirstReport firstReport, UnstartedPeriodicTaskComponent.LastReport lastReport)
-
-
Method Details
-
start
public void start() -
task
protected abstract void task()This task should only do what is needed once each period. If it throws any exceptions, then these exceptions will cause the period task to exit. Thus, if you need to allow failures in some cases while keeping the caller (scheduler) active, all errors should be caught and handled internally. -
run
-
teardown
public void teardown()Description copied from class:NBBaseComponentOverride this method in your component implementations when you need to do something to close out your component.- Overrides:
teardownin classNBBaseComponent
-