Returns an estimate on the number of remaining elements.
Returns an estimate on the number of remaining elements.
Can only be called on stealers that are in the stolen state.
Can only be called on stealers that are in the stolen state.
It will return a pair of stealers traversing the remaining elements of the current stealer.
Attempts to cast this stealer into a precise stealer.
Attempts to cast this stealer into a precise stealer.
Optional.
Optional.
A shortcut method that checks if the stealer is in the available state.
A shortcut method that checks if the stealer is in the available state.
Attempts to push the stealer to the Completed
state.
Attempts to push the stealer to the Completed
state.
Only changes the state if the stealer was in the AvailableOrOwned
state, otherwise does nothing.
Note: after having called this operation, the node will either be stolen or completed.
true
if node ends in the Completed
state, false
if it ends in the StolenOrExpanded
state
Attempts to push the stealer to the Stolen
state.
Attempts to push the stealer to the Stolen
state.
Only changes the state if the stealer was in the AvailableOrOwned
state, otherwise does nothing.
Note: after having called this operation, the node will either be stolen or completed.
false
if node ends in the Completed
state, true
if it ends in the StolenOrExpanded
state
Minimum stealing threshold above which this stealer can be stolen and split.
Minimum stealing threshold above which this stealer can be stolen and split.
Note: splitting and stealing still work if there are less elements, but the scheduler will not split such stealers.
Commits to processing a block of elements by using next
and hasNext
.
Commits to processing a block of elements by using next
and hasNext
.
Once hasNext
has returned false
, nextBatch
can be called again.
approximate number of elements to commit to processing
-1
if the stealer is not in the AvailableOrOwned
state, otherwise
an approximation on the number of elements that calls to next
will return.
Stealer state can be AvailableOrOwned
, Completed
or StolenOrExpanded
.
Stealer state can be AvailableOrOwned
, Completed
or StolenOrExpanded
.
Stealer state can change from available to either completed or stolen, but cannot change once it is completed or stolen.
Base class for all stealers operating on index-based collections. can be not-precise in sence that can return different amount of elements for different indeces.