Class ContiguousOutputChunker

java.lang.Object
io.nosqlbench.engine.api.activityimpl.marker.ContiguousOutputChunker
All Implemented Interfaces:
Output, AutoCloseable

public class ContiguousOutputChunker extends Object implements Output
This is the default cycle output implementation for NB when the input cycles are known to be contiguous.

This cycle marker wraps another tracking structure in order to allow for flexible buffering methods. The extents are buffer segments which can be managed atomically. They are chained here in two chains: The marking chain and the tracking chain. When the atomic marking head is non-null, then marking is possible, but marking calls block otherwise. The same is true for the tracking head element.

The nowMarking and nowTracking conditions are meant to be locked and awaited by marking and tracking calls respectively. Conversely, they are expected to be signaled by tracking and marking calls.

This implementation needs to be adapted to onAfterOpStop early exit of either marker or tracker threads with no deadlock.

  • Constructor Details

    • ContiguousOutputChunker

      public ContiguousOutputChunker(long min, long nextRangeMin, int extentSize, int maxExtents)
    • ContiguousOutputChunker

      public ContiguousOutputChunker(Activity activity)
  • Method Details

    • onCycleResultSegment

      public void onCycleResultSegment(CycleResultsSegment segment)
      Specified by:
      onCycleResultSegment in interface Output
    • onCycleResult

      public boolean onCycleResult(long completedCycle, int result)
      Description copied from interface: Output
      Mark the result of the numbered cycle with an integer value. The meaning of the value provided is contextual to the way it is used. (Each process will have its own status tables, etc.)
      Specified by:
      onCycleResult in interface Output
      Parameters:
      completedCycle - The cycle number being marked.
      result - the result ordinal
      Returns:
      true on success, false if the marking should be retried differently
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Output
      Throws:
      Exception
    • addExtentReader

      public void addExtentReader(Output reader)
    • removeExtentReader

      public void removeExtentReader(Output reader)
    • toString

      public String toString()
      Overrides:
      toString in class Object