Class ByteTrackerExtent
java.lang.Object
io.nosqlbench.engine.api.activityimpl.marker.ByteTrackerExtent
- All Implemented Interfaces:
CycleResultSegmentsReadable,Iterable<CycleResultsSegment>
A simple bytebuffer marker implementation
-
Constructor Summary
ConstructorsConstructorDescriptionByteTrackerExtent(long min, int[] ints) ByteTrackerExtent(long min, long nextMin) Create a simple marker extent -
Method Summary
Modifier and TypeMethodDescriptionextend()Find the last known extent, and add another after it, account for contiguous ranges and extent getCount.intlonggetMin()intgetSize()booleaniterator()longmarkResult(long cycle, int result) mark the named cycle in the extent, or in any future extent that we know.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.cyclelog.buffers.CycleResultSegmentsReadable
getCycleResultIterableMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
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 trackernextMin- 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:- negative value: indicates an attempt to mark a value outside the range, either before min or after max of the furthest known extent
- 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.
- positive value: indicates how many cycles remain available in the extent to be marked.
- Parameters:
cycle- The cycle to be markedresult- the result code to mark in the cycle- Returns:
- the number of cycles remaining after marking, or a negative number indicating an error.
-
getRemainingSegment
-
toString
-
isFullyFilled
public boolean isFullyFilled() -
getNextExtent
-
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
-
iterator
- Specified by:
iteratorin interfaceIterable<CycleResultsSegment>
-