Class BaseOpDispenser<T extends Op>

java.lang.Object
io.nosqlbench.engine.api.activityimpl.BaseOpDispenser<T>
Type Parameters:
T - The type of operation
All Implemented Interfaces:
OpDispenser<T>, OpResultTracker, LongFunction<T>
Direct Known Subclasses:
StandardOpDispenser

public abstract class BaseOpDispenser<T extends Op> extends Object implements OpDispenser<T>
See OpDispenser for details on how to use this type. Some details are tracked per op template, which aligns to the life-cycle of the op dispenser. Thus, each op dispenser is where the stats for all related operations are kept.
  • Constructor Details

  • Method Details

    • getAdapter

      public DriverAdapter getAdapter()
    • apply

      public abstract T apply(long cycle)
      The apply method in an op dispenser should do all the work of creating an operation that is executable by some other caller. The value produced by the apply method should not require additional processing if a caller wants to execute the operation multiple times, as for retries.
      Specified by:
      apply in interface LongFunction<T extends Op>
      Specified by:
      apply in interface OpDispenser<T extends Op>
      Parameters:
      cycle - The cycle number which serves as the seed for any generated op fields to be bound into an operation.
      Returns:
    • onStart

      public void onStart(long cycleValue)
      Specified by:
      onStart in interface OpResultTracker
    • onSuccess

      public void onSuccess(long cycleValue, long nanoTime, long resultsize)
      Specified by:
      onSuccess in interface OpResultTracker
    • onError

      public void onError(long cycleValue, long resultNanos, Throwable t)
      Specified by:
      onError in interface OpResultTracker