Class ContiguousOutputChunker
java.lang.Object
io.nosqlbench.engine.api.activityimpl.marker.ContiguousOutputChunker
- All Implemented Interfaces:
Output,AutoCloseable
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 Summary
ConstructorsConstructorDescriptionContiguousOutputChunker(long min, long nextRangeMin, int extentSize, int maxExtents) ContiguousOutputChunker(Activity activity) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtentReader(Output reader) voidclose()booleanonCycleResult(long completedCycle, int result) Mark the result of the numbered cycle with an integer value.voidonCycleResultSegment(CycleResultsSegment segment) voidremoveExtentReader(Output reader) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.nosqlbench.engine.api.activityapi.output.Output
onCycleResult
-
Constructor Details
-
ContiguousOutputChunker
public ContiguousOutputChunker(long min, long nextRangeMin, int extentSize, int maxExtents) -
ContiguousOutputChunker
-
-
Method Details
-
onCycleResultSegment
- Specified by:
onCycleResultSegmentin interfaceOutput
-
onCycleResult
public boolean onCycleResult(long completedCycle, int result) Description copied from interface:OutputMark 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:
onCycleResultin interfaceOutput- Parameters:
completedCycle- The cycle number being marked.result- the result ordinal- Returns:
- true on success, false if the marking should be retried differently
-
close
-
addExtentReader
-
removeExtentReader
-
toString
-