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.OffsetRangeasResidual()booleanequals(java.lang.Object o)PartitiongetPartition()inthashCode()static OffsetRestrictionTracker.OffsetRangeinitialRestriction(long limit, boolean bounded)booleanisFinished()Verify that we have processed the whole restriction.booleanisInitial()booleanisLimitConsumed()booleanisSplittable()Verify that we can split this restriction.OffsetRestrictionTrackernewTracker()static OffsetRestrictionTracker.OffsetRangereadingPartition(Partition partition, Position position, long limit, boolean bounded)OffsetRestrictionTracker.OffsetRangetoPrimary()
-
-
-
Method Detail
-
initialRestriction
public static OffsetRestrictionTracker.OffsetRange initialRestriction(long limit, boolean bounded)
- Parameters:
limit- total limit to readbounded-trueif 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:
newTrackerin 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:
trueif watermark has arrived to final instant
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-