Package com.emc.mongoose.base.load.step
Class LoadStepBase
- java.lang.Object
-
- com.github.akurilov.commons.concurrent.AsyncRunnableBase
-
- com.emc.mongoose.base.concurrent.DaemonBase
-
- com.emc.mongoose.base.load.step.LoadStepBase
-
- All Implemented Interfaces:
Daemon,LoadStep,com.github.akurilov.commons.concurrent.AsyncRunnable,java.lang.Runnable,java.rmi.Remote
- Direct Known Subclasses:
LoadStepClientBase,LoadStepLocalBase
public abstract class LoadStepBase extends DaemonBase implements LoadStep, java.lang.Runnable
-
-
Field Summary
Fields Modifier and Type Field Description protected com.github.akurilov.confuse.Configconfigprotected java.util.List<com.github.akurilov.confuse.Config>ctxConfigsprotected java.util.List<Extension>extensionsprotected java.util.List<MetricsContext<? extends AllMetricsSnapshot>>metricsContextsprotected MetricsManagermetricsMgr
-
Constructor Summary
Constructors Modifier Constructor Description protectedLoadStepBase(com.github.akurilov.confuse.Config config, java.util.List<Extension> extensions, java.util.List<com.github.akurilov.confuse.Config> ctxConfigs, MetricsManager metricsMgr)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected intavgPeriod(com.github.akurilov.confuse.Config metricsConfig)protected voiddoClose()protected voiddoStart()protected abstract voiddoStartWrapped()protected voiddoStop()protected abstract voidinit()Initializes the actual configuration and metrics contextsprotected abstract voidinitMetrics(int originIndex, OpType opType, int concurrency, com.github.akurilov.confuse.Config metricsConfig, com.github.akurilov.commons.system.SizeInBytes itemDataSize, boolean outputColorFlag)java.lang.StringloadStepId()java.util.List<? extends AllMetricsSnapshot>metricsSnapshots()voidrun()longrunId()-
Methods inherited from class com.emc.mongoose.base.concurrent.DaemonBase
close, closeAll
-
Methods inherited from class com.github.akurilov.commons.concurrent.AsyncRunnableBase
await, await, doShutdown, isClosed, isInitial, isShutdown, isStarted, isStopped, shutdown, start, state, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
config
protected final com.github.akurilov.confuse.Config config
-
extensions
protected final java.util.List<Extension> extensions
-
ctxConfigs
protected final java.util.List<com.github.akurilov.confuse.Config> ctxConfigs
-
metricsMgr
protected final MetricsManager metricsMgr
-
metricsContexts
protected final java.util.List<MetricsContext<? extends AllMetricsSnapshot>> metricsContexts
-
-
Constructor Detail
-
LoadStepBase
protected LoadStepBase(com.github.akurilov.confuse.Config config, java.util.List<Extension> extensions, java.util.List<com.github.akurilov.confuse.Config> ctxConfigs, MetricsManager metricsMgr)
-
-
Method Detail
-
loadStepId
public final java.lang.String loadStepId()
- Specified by:
loadStepIdin interfaceLoadStep- Returns:
- the step id
-
metricsSnapshots
public final java.util.List<? extends AllMetricsSnapshot> metricsSnapshots()
- Specified by:
metricsSnapshotsin interfaceLoadStep
-
run
public final void run()
- Specified by:
runin interfacejava.lang.Runnable
-
doStart
protected void doStart() throws java.lang.IllegalStateException- Overrides:
doStartin classcom.github.akurilov.commons.concurrent.AsyncRunnableBase- Throws:
java.lang.IllegalStateException
-
doStartWrapped
protected abstract void doStartWrapped()
-
init
protected abstract void init() throws java.lang.IllegalStateExceptionInitializes the actual configuration and metrics contexts- Throws:
java.lang.IllegalStateException- if initialization fails
-
initMetrics
protected abstract void initMetrics(int originIndex, OpType opType, int concurrency, com.github.akurilov.confuse.Config metricsConfig, com.github.akurilov.commons.system.SizeInBytes itemDataSize, boolean outputColorFlag)
-
doStop
protected void doStop()
- Overrides:
doStopin classcom.github.akurilov.commons.concurrent.AsyncRunnableBase
-
doClose
protected void doClose() throws java.io.IOException- Overrides:
doClosein classcom.github.akurilov.commons.concurrent.AsyncRunnableBase- Throws:
java.io.IOException
-
avgPeriod
protected int avgPeriod(com.github.akurilov.confuse.Config metricsConfig)
-
-