Class OffsetRestrictionTracker.OffsetRange
- java.lang.Object
-
- cz.o2.proxima.beam.core.direct.io.OffsetRestrictionTracker.OffsetRange
-
- All Implemented Interfaces:
java.io.Serializable
,org.apache.beam.sdk.transforms.splittabledofn.HasDefaultTracker<OffsetRestrictionTracker.OffsetRange,OffsetRestrictionTracker>
- Enclosing class:
- OffsetRestrictionTracker
public static class OffsetRestrictionTracker.OffsetRange extends java.lang.Object implements java.io.Serializable, org.apache.beam.sdk.transforms.splittabledofn.HasDefaultTracker<OffsetRestrictionTracker.OffsetRange,OffsetRestrictionTracker>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OffsetRange(Offset startOffsetExclusive, Offset endOffsetInclusive, long totalLimit, boolean bounded, long consumed)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OffsetRestrictionTracker.OffsetRange
asResidual()
boolean
equals(java.lang.Object o)
Partition
getPartition()
int
hashCode()
static OffsetRestrictionTracker.OffsetRange
initialRestriction(long limit, boolean bounded)
boolean
isFinished()
Verify that we have processed the whole restriction.boolean
isInitial()
boolean
isLimitConsumed()
boolean
isSplittable()
Verify that we can split this restriction.OffsetRestrictionTracker
newTracker()
static OffsetRestrictionTracker.OffsetRange
readingPartition(Partition partition, Position position, long limit, boolean bounded)
OffsetRestrictionTracker.OffsetRange
toPrimary()
-
-
-
Method Detail
-
initialRestriction
public static OffsetRestrictionTracker.OffsetRange initialRestriction(long limit, boolean bounded)
- Parameters:
limit
- total limit to readbounded
-true
if this is bounded restriction- Returns:
- initial restriction for
DoFn.GetInitialRestriction
.*
-
readingPartition
public static OffsetRestrictionTracker.OffsetRange readingPartition(Partition partition, Position position, long limit, boolean bounded)
- Returns:
- restriction that reads from given offset (inclusive)
-
getPartition
public Partition getPartition()
-
isLimitConsumed
public boolean isLimitConsumed()
-
toPrimary
public OffsetRestrictionTracker.OffsetRange toPrimary()
- Returns:
- unmodifiable already processed split of the restriction
-
asResidual
public OffsetRestrictionTracker.OffsetRange asResidual()
- Returns:
- residual of not-yet processed work Note that, at all times the primary + residual should be equivalent to the original (non-split) range.
-
isInitial
public boolean isInitial()
-
newTracker
public OffsetRestrictionTracker newTracker()
- Specified by:
newTracker
in interfaceorg.apache.beam.sdk.transforms.splittabledofn.HasDefaultTracker<OffsetRestrictionTracker.OffsetRange,OffsetRestrictionTracker>
-
isSplittable
public boolean isSplittable()
Verify that we can split this restriction. A restriction is not splittable if it has not been yet started - i.e. no offset has been claimed.
-
isFinished
public boolean isFinished()
Verify that we have processed the whole restriction.- Returns:
true
if watermark has arrived to final instant
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-