public abstract class RestrictionTracker<RestrictionT,PositionT> extends java.lang.Object
|Constructor and Description|
|Modifier and Type||Method and Description|
Called by the runner after
Signals that the current
Returns a restriction accurately describing the full range of work the current
Attempts to claim the block of work in the current restriction identified by the given position.
public abstract boolean tryClaim(PositionT position)
If this succeeds, the DoFn MUST execute the entire block of work. If this fails:
DoFn.ProcessContinuation#stopwithout performing any additional work or emitting output (note that emitting output or performing work from
DoFn.ProcessElementis also not allowed before the first call to this method).
public abstract RestrictionT currentRestriction()
DoFn.ProcessElementcall will do, including already completed work.
public abstract RestrictionT checkpoint()
DoFn.ProcessElementcall should terminate as soon as possible: after this method returns, the tracker MUST refuse all future claim calls, and
currentRestriction(). Returns a restriction representing the rest of the
work: the old value of
currentRestriction() is equivalent to the new value and the
return value of this method combined.
Must be called at most once on a given object. Must not be called before the first
public abstract void checkDone() throws java.lang.IllegalStateException
Must throw an exception with an informative error message, if there is still any unclaimed work remaining in the restriction.