Class AtomicInput

java.lang.Object
io.nosqlbench.engine.api.activityimpl.input.AtomicInput
All Implemented Interfaces:
ActivityDefObserver, Input, ProgressCapable

public class AtomicInput
extends java.lang.Object
implements Input, ActivityDefObserver, ProgressCapable

TODO: This documentation is out of date as of 2.0.0

This input will provide threadsafe access to a sequence of long values.

Changes to the cycles or the targetrate will affect the provided inputs. If the min or max cycle is changed, then these are re-applied first to the max cycle and then to the min cycle. If the min cycle is changed, then the next cycle value is set to the assigned min value. Otherwise, the cycle will continue as usual till it reaches the max value. The ability to start the input while running by applying a new set of parameters makes it possible to re-trigger a sequence of inputs during a test.

This input, and Inputs in general do not actively prevent usage of values after the max value. They simply expose it to callers. It is up to the caller to check the value to determine when the input is deemed "used up."

  • Constructor Summary

    Constructors 
    Constructor Description
    AtomicInput​(io.nosqlbench.engine.api.activityimpl.ActivityDef activityDef)  
  • Method Summary

    Modifier and Type Method Description
    CycleSegment getInputSegment​(int stride)
    Return the next InputSegment available, or null if none were available.
    io.nosqlbench.engine.api.activityimpl.input.AtomicInput.AtomicInputProgress getProgressMeter()  
    long getStarteAtMillis()  
    boolean isContiguous()  
    void onActivityDefUpdate​(io.nosqlbench.engine.api.activityimpl.ActivityDef activityDef)  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AtomicInput

      public AtomicInput​(io.nosqlbench.engine.api.activityimpl.ActivityDef activityDef)
  • Method Details

    • getInputSegment

      public CycleSegment getInputSegment​(int stride)
      Description copied from interface: Input
      Return the next InputSegment available, or null if none were available. This method is required to be thread safe.

      All implementations of this method are required to be thread-safe.

      Specified by:
      getInputSegment in interface Input
      Parameters:
      stride - The number of cycles (not necessarily contiguous) in the segment.
      Returns:
      a segment, or null if none available.
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • onActivityDefUpdate

      public void onActivityDefUpdate​(io.nosqlbench.engine.api.activityimpl.ActivityDef activityDef)
      Specified by:
      onActivityDefUpdate in interface ActivityDefObserver
    • getStarteAtMillis

      public long getStarteAtMillis()
    • isContiguous

      public boolean isContiguous()
      Specified by:
      isContiguous in interface Input
    • getProgressMeter

      public io.nosqlbench.engine.api.activityimpl.input.AtomicInput.AtomicInputProgress getProgressMeter()
      Specified by:
      getProgressMeter in interface ProgressCapable