Class ByteTrackerExtent

java.lang.Object
io.nosqlbench.engine.api.activityimpl.marker.ByteTrackerExtent
All Implemented Interfaces:
CycleResultSegmentsReadable, Iterable<CycleResultsSegment>

public class ByteTrackerExtent extends Object implements CycleResultSegmentsReadable
A simple bytebuffer marker implementation
  • Constructor Details

    • ByteTrackerExtent

      public ByteTrackerExtent(long min, long nextMin)
      Create a simple marker extent
      Parameters:
      min - the first logical cycle to be returned by this tracker
      nextMin - the first logical cycle of the next range
    • ByteTrackerExtent

      public ByteTrackerExtent(long min, int[] ints)
  • Method Details

    • markResult

      public long markResult(long cycle, int result)
      mark the named cycle in the extent, or in any future extent that we know. The return value determines the known state of the current extent:
      1. negative value: indicates an attempt to mark a value outside the range, either before min or after max of the furthest known extent
      2. zero: indicates successful marking, but exactly no remaining space available. This is how a marking thread can detect that it was the one that finished marking an extent.
      3. positive value: indicates how many cycles remain available in the extent to be marked.
      Parameters:
      cycle - The cycle to be marked
      result - the result code to mark in the cycle
      Returns:
      the number of cycles remaining after marking, or a negative number indicating an error.
    • getRemainingSegment

      public CycleResultsIntervalSegment getRemainingSegment()
    • toString

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

      public boolean isFullyFilled()
    • getNextExtent

      public AtomicReference<ByteTrackerExtent> getNextExtent()
    • extend

      public ByteTrackerExtent extend()
      Find the last known extent, and add another after it, account for contiguous ranges and extent getCount. Note that this does not mean necessarily that the extent will be added immediately after the current one.
      Returns:
      The new extent that was created.
    • getMin

      public long getMin()
    • getSize

      public int getSize()
    • getChainSize

      public int getChainSize()
    • rangeSummary

      public String rangeSummary()
    • iterator

      public Iterator<CycleResultsSegment> iterator()
      Specified by:
      iterator in interface Iterable<CycleResultsSegment>