Class OpImpl<D>

java.lang.Object
io.nosqlbench.engine.api.activityapi.core.ops.fluent.opfacets.OpImpl<D>
All Implemented Interfaces:
CompletedOp<D>, FailedOp<D>, OpFacets<D>, Payload<D>, SkippedOp<D>, StartedOp<D>, SucceededOp<D>, TrackedOp<D>, CycleMutable, CycleReadable, CycleResult, ResultReadable, Comparable<CycleResult>
Direct Known Subclasses:
EventedOpImpl

public class OpImpl<D> extends Object implements OpFacets<D>
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    fail(int status)
    Mark this op as failed as of the time it is called, and record the resulting status code.
    long
    Return the nanos that have elapsed since this op was started at the time of this call, plus any prior waittime.
    long
    Return the nanos that have elapsed since the op was started at the time of this call.
    long
    get the cycle number associated with this element.
     
    long
     
    int
    Get a result associated with some operation, according to the activity-specific result map
    long
     
    int
     
    long
    Get the nanosecond instant which was recorded for this operation to be started.
    int
     
    Reset the service timer on this op, and increment the tries counter
    void
    setCycle(long cycle)
    set the cycle number associated with this element.
    void
    setData(D data)
     
    setWaitTime(long waitTime)
    Indicate to this op, how much wait time elapsed between the time it was expected to start and the time it actually started.
    skip(int reason)
    Mark that this operation is being skipped by the activity type for some reason.
    Signify to NB that the associated operation is known to have started processing in some specific way according to the implementing activity type.
    succeed(int status)
    Mark this op as successful as of the time it is called, and record the resulting status code.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.CycleResult

    compareTo

    Methods inherited from interface io.nosqlbench.engine.api.activityapi.core.ops.fluent.opfacets.OpFacets

    compareTo
  • Constructor Details

    • OpImpl

      public OpImpl()
  • Method Details

    • start

      public StartedOp<D> start()
      Description copied from interface: TrackedOp
      Signify to NB that the associated operation is known to have started processing in some specific way according to the implementing activity type. This should be called after any operational setup work that would not occur in a typical application client scenario. The moment this is called, the start time for the operation is marked.
      Specified by:
      start in interface TrackedOp<D>
      Returns:
      a StartedOp of the appropriate generic delegate type
    • setWaitTime

      public OpImpl<D> setWaitTime(long waitTime)
      Description copied from interface: TrackedOp
      Indicate to this op, how much wait time elapsed between the time it was expected to start and the time it actually started. This is used to calculate the response time once service time is known.
      Specified by:
      setWaitTime in interface TrackedOp<D>
      Parameters:
      waitTime - nanosecond delay
      Returns:
      a TrackedOp for method chaining
    • succeed

      public SucceededOp<D> succeed(int status)
      Description copied from interface: StartedOp
      Mark this op as successful as of the time it is called, and record the resulting status code.
      Specified by:
      succeed in interface StartedOp<D>
      Parameters:
      status - The status for this op, determined by individual activity types
      Returns:
      a SucceededOp
    • fail

      public FailedOp<D> fail(int status)
      Description copied from interface: StartedOp
      Mark this op as failed as of the time it is called, and record the resulting status code.
      Specified by:
      fail in interface StartedOp<D>
      Parameters:
      status - The status for this op, determined by individual activity types
      Returns:
      A FailedOp
    • retry

      public StartedOp<D> retry()
      Description copied from interface: StartedOp
      Reset the service timer on this op, and increment the tries counter
      Specified by:
      retry in interface StartedOp<D>
      Returns:
      A StartedOp
    • skip

      public SkippedOp<D> skip(int reason)
      Description copied from interface: TrackedOp
      Mark that this operation is being skipped by the activity type for some reason.
      Specified by:
      skip in interface TrackedOp<D>
      Parameters:
      reason - An integer code, activity type specific, to track why the operation was skipped
      Returns:
      a SkippedOp of the appropriate generic delegate type
    • getCycle

      public long getCycle()
      Description copied from interface: CycleReadable
      get the cycle number associated with this element.
      Specified by:
      getCycle in interface CycleReadable
      Returns:
      a cycle number
    • setCycle

      public void setCycle(long cycle)
      Description copied from interface: CycleMutable
      set the cycle number associated with this element.
      Specified by:
      setCycle in interface CycleMutable
      Parameters:
      cycle - The cycle for this operation
    • getStartedAtNanos

      public long getStartedAtNanos()
      Description copied from interface: StartedOp
      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.
      Specified by:
      getStartedAtNanos in interface CompletedOp<D>
      Specified by:
      getStartedAtNanos in interface StartedOp<D>
      Returns:
      nanoseconds started instant
    • getOpData

      public D getOpData()
      Specified by:
      getOpData in interface Payload<D>
    • setData

      public void setData(D data)
      Specified by:
      setData in interface Payload<D>
    • getTries

      public int getTries()
      Specified by:
      getTries in interface FailedOp<D>
      Specified by:
      getTries in interface SucceededOp<D>
    • getCurrentServiceTimeNanos

      public long getCurrentServiceTimeNanos()
      Description copied from interface: StartedOp
      Return the nanos that have elapsed since the op was started at the time of this call.
      Specified by:
      getCurrentServiceTimeNanos in interface StartedOp<D>
      Returns:
      nanosecond service time duration
    • getCurrentResponseTimeNanos

      public long getCurrentResponseTimeNanos()
      Description copied from interface: StartedOp
      Return the nanos that have elapsed since this op was started at the time of this call, plus any prior waittime.
      Specified by:
      getCurrentResponseTimeNanos in interface StartedOp<D>
      Returns:
      nanosecond response time duration
    • getServiceTimeNanos

      public long getServiceTimeNanos()
      Specified by:
      getServiceTimeNanos in interface CompletedOp<D>
    • getResponseTimeNanos

      public long getResponseTimeNanos()
      Specified by:
      getResponseTimeNanos in interface CompletedOp<D>
    • getResult

      public int getResult()
      Description copied from interface: ResultReadable
      Get a result associated with some operation, according to the activity-specific result map
      Specified by:
      getResult in interface ResultReadable
      Returns:
      an activity-specific result code
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getSkippedReason

      public int getSkippedReason()
      Specified by:
      getSkippedReason in interface SkippedOp<D>