Class CycleArray.ArraySegment

java.lang.Object
io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.CycleArray.ArraySegment
All Implemented Interfaces:
CycleSegment
Enclosing class:
CycleArray

public static class CycleArray.ArraySegment
extends java.lang.Object
implements CycleSegment
  • Constructor Summary

    Constructors 
    Constructor Description
    ArraySegment​(long[] values)  
  • Method Summary

    Modifier and Type Method Description
    boolean isExhausted()  
    long nextCycle()
    The next cycle, which should be a positive number between 0 and Long.MAX_VALUE.
    long peekNextCycle()
    Return the value of the next cycle which would be returned by CycleSegment.nextCycle()} without modifying the segment, or a negative number if the cycle range would be outside the valid range for this segment.

    Methods inherited from class java.lang.Object

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

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

    nextCycles
  • Constructor Details

  • Method Details

    • nextCycle

      public long nextCycle()
      Description copied from interface: CycleSegment
      The next cycle, which should be a positive number between 0 and Long.MAX_VALUE. If a negative value is returned, then the caller should disregard the value and assume that any further input segments will be invalid.

      Implementations of this method should not worry about thread safety.

      Specified by:
      nextCycle in interface CycleSegment
      Returns:
      a positive and valid long cycle, or a negative indicator of end of input
    • peekNextCycle

      public long peekNextCycle()
      Description copied from interface: CycleSegment
      Return the value of the next cycle which would be returned by CycleSegment.nextCycle()} without modifying the segment, or a negative number if the cycle range would be outside the valid range for this segment.
      Specified by:
      peekNextCycle in interface CycleSegment
      Returns:
      the next cycle that will be returned
    • isExhausted

      public boolean isExhausted()
      Specified by:
      isExhausted in interface CycleSegment
      Returns:
      true if the input can provide no further cycles