Interface StartedOp<D>
- Type Parameters:
D- The delegate type that is need for the implementing activity type
- All Superinterfaces:
CycleReadable,Payload<D>
- All Known Subinterfaces:
OpFacets<D>
- All Known Implementing Classes:
EventedOpImpl,OpImpl
A StartedOp is a type that represents that an operation has been sent to some
specific type of protocol or logic.
Correctness
It is essential that developers close a StartedOp in one of the appropriate ways. Creating a StartedOp and not calling eithersucceed(int), or fail(int)
will cause deadlocks in concurrency management. This is because the logic which tracks
operations relies on these signals to know when to close out an operation and allow
another to be started according to concurrency controls.
retry() can be called as many times as an activity allows for, but this is
not sufficient to retire the operation. After calling retry(), one of the
end states above must be set.-
Method Summary
Modifier and TypeMethodDescriptionfail(int status) Mark this op as failed as of the time it is called, and record the resulting status code.longReturn the nanos that have elapsed since this op was started at the time of this call, plus any prior waittime.longReturn the nanos that have elapsed since the op was started at the time of this call.longGet the nanosecond instant which was recorded for this operation to be started.retry()Reset the service timer on this op, and increment the tries countersucceed(int status) Mark this op as successful as of the time it is called, and record the resulting status code.Methods inherited from interface io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.CycleReadable
getCycle
-
Method Details
-
retry
-
succeed
Mark this op as successful as of the time it is called, and record the resulting status code.- Parameters:
status- The status for this op, determined by individual activity types- Returns:
- a SucceededOp
-
fail
-
getStartedAtNanos
long getStartedAtNanos()Get the nanosecond instant which was recorded for this operation to be started. Specifically, this is when the operation was known to enter a native protocol or activity type section of logic which is more than just preparatory work by the client before execution.- Returns:
- nanoseconds started instant
-
getCurrentServiceTimeNanos
long getCurrentServiceTimeNanos()Return the nanos that have elapsed since the op was started at the time of this call.- Returns:
- nanosecond service time duration
-
getCurrentResponseTimeNanos
long getCurrentResponseTimeNanos()Return the nanos that have elapsed since this op was started at the time of this call, plus any prior waittime.- Returns:
- nanosecond response time duration
-