|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
A representation for the amount of known work represented as a size.
Attempts to claim the given offset.
public OffsetRangeTracker(OffsetRange range)
public OffsetRange currentRestriction()
DoFn.ProcessElementcall will do, including already completed work.
public OffsetRange checkpoint()
DoFn.ProcessElementcall should terminate as soon as possible: after this method returns, the tracker MUST refuse all future claim calls, and
RestrictionTracker.currentRestriction(). Returns a restriction representing the rest of the
work: the old value of
RestrictionTracker.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.
public boolean tryClaim(java.lang.Long i)
Must be larger than the last successfully claimed offset.
public 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.
public java.lang.String toString()
public double getSize()
doublerepresentations should preferably represent a linear space and be comparable within the same partition.
It is up to each restriction tracker to convert between their natural representation of outstanding work and this representation. For example:
message bytesthat have not been processed.
DoFns should provide a method annotated with
DoFn.GetPartition to report a
partition identifier if the element and restriction represent the size for a shared resource
such as a message queue topic. See
DoFn.GetPartition for additional details.