Class BaseAsyncAction<D,A extends Activity>
java.lang.Object
io.nosqlbench.engine.api.activityapi.core.BaseAsyncAction<D,A>
- Type Parameters:
D- An type of state holder for an operation, holding everything unique to that cycle and operationA- An type of of an Activity, a state holder for a runtime instance of an Activity
- All Implemented Interfaces:
Action,ActivityDefObserver,AsyncAction<D>,Stoppable
public abstract class BaseAsyncAction<D,A extends Activity>
extends Object
implements AsyncAction<D>, Stoppable, ActivityDefObserver
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTHIS DOCUMENTATION IS LIKELY OUT OF DATE The responsibility for tracking async pending against concurrency limits, including signaling for thread state, has been moved into the async event loop of the core motor.voidonActivityDefUpdate(ActivityDef activityDef) voidAsk this component to stop cycling.abstract voidstartOpCycle(TrackedOp<D> opc) Implementations that extend this base class can call this method in order to put an operation in flight.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.nosqlbench.engine.api.activityapi.core.AsyncAction
getOpInitFunction
-
Field Details
-
activity
-
slot
protected int slot -
running
protected boolean running
-
-
Constructor Details
-
BaseAsyncAction
-
-
Method Details
-
onActivityDefUpdate
- Specified by:
onActivityDefUpdatein interfaceActivityDefObserver
-
enqueue
Description copied from interface:AsyncActionTHIS DOCUMENTATION IS LIKELY OUT OF DATE The responsibility for tracking async pending against concurrency limits, including signaling for thread state, has been moved into the async event loop of the core motor. If this experiment holds, then the docs here must be rewritten to be accurate for that approach. Enqueue a cycle to be executed by the action. This method should block unless or until the action accepts the cycle to be processed. This method is not allowed to reject a cycle. If it is unable to accept the cycle for any reason, it must throw an exception. Since the action implementation is presumed to be running some externally asynchronous process to support the action, it is up to the action itself to control when to block enqueueing. If the action is not actually asynchronous, then it may need to do downstream processing in order to open room in its concurrency limits for the new cycle. Each action implementation is responsible for tracking and controlling its own limits of concurrency. TheBaseAsyncActionbase class is a convenient starting point for such implementations. If the action is known to have additional open slots for an operations to be started (according to the configured concurrency limits), then it can signal such by returning true from this method.- Specified by:
enqueuein interfaceAsyncAction<D>- Parameters:
opc- The op ctx that holds state for this operation- Returns:
- true, if the action is ready immediately for another operation
-
startOpCycle
Implementations that extend this base class can call this method in order to put an operation in flight. Implementations should call eitherTrackedOp.skip(int)orTrackedOp.start()}.- Parameters:
opc- A tracked operation with state of parameterized type D
-
requestStop
public void requestStop()Description copied from interface:StoppableAsk this component to stop cycling. This is an asynchronous request. Once the current active cycle completes, the request will cause the component to stop cooperatively.- Specified by:
requestStopin interfaceStoppable
-