Class ActivityDef
java.lang.Object
io.nosqlbench.api.engine.activityimpl.ActivityDef
- All Implemented Interfaces:
NBNamedElement
A runtime definition for an activity.
Instances of ActivityDef hold control values for the execution of a single activity. Each thread of the related activity is initialized with the associated ActivityDef. When the ActivityDef is modified, interested activity threads are notified so that they can dynamically adjust.
The canonical values for all parameters are kept internally in the parameter map. Essentially, ActivityDef is just a type-aware wrapper around a thread-safe parameter map, with an atomic change counter which can be used to signal changes to observers.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAlias()The alias that the associated activity instance is known by.longlongThe last cycle that will be used for execution of this activity, inclusive.getName()Get the parameter map, which is the backing-store for all data within an ActivityDef.longThe first cycle that will be used for execution of this activity, inclusive.intThe number of threads (AKA slots) that the associated activity should currently be using.static ActivityDefparseActivityDef(String namedActivitySpec) static Optional<ActivityDef>parseActivityDefOptionally(String namedActivitySpec) voidvoidsetEndCycle(long endCycle) voidsetEndCycle(String endCycle) voidsetStartCycle(long startCycle) voidsetStartCycle(String startCycle) voidsetThreads(int threads) toString()
-
Field Details
-
DEFAULT_ALIAS
- See Also:
-
DEFAULT_ATYPE
- See Also:
-
DEFAULT_CYCLES
- See Also:
-
DEFAULT_THREADS
public static final int DEFAULT_THREADS- See Also:
-
-
Constructor Details
-
ActivityDef
-
-
Method Details
-
parseActivityDefOptionally
-
parseActivityDef
-
toString
-
getAlias
The alias that the associated activity instance is known by.- Returns:
- the alias
-
getActivityType
-
getStartCycle
public long getStartCycle()The first cycle that will be used for execution of this activity, inclusive. If the value is provided as a range as in 0..10, then the first number is the start cycle and the second number is the end cycle +1. Effectively, cycle ranges are [closed,open) intervals, as in [min..max)- Returns:
- the long start cycle
-
setStartCycle
public void setStartCycle(long startCycle) -
setStartCycle
-
setEndCycle
-
getEndCycle
public long getEndCycle()The last cycle that will be used for execution of this activity, inclusive.- Returns:
- the long end cycle
-
setEndCycle
public void setEndCycle(long endCycle) -
getThreads
public int getThreads()The number of threads (AKA slots) that the associated activity should currently be using.- Returns:
- target thread count
-
setThreads
public void setThreads(int threads) -
getParams
Get the parameter map, which is the backing-store for all data within an ActivityDef.- Returns:
- the parameter map
-
getChangeCounter
-
setCycles
-
getCycleSummary
-
getCycleCount
public long getCycleCount() -
getName
- Specified by:
getNamein interfaceNBNamedElement
-