Class OffsetRestrictionTracker.OffsetRange

    • Constructor Detail

      • OffsetRange

        public OffsetRange​(Offset startOffsetExclusive,
                           Offset endOffsetInclusive,
                           long totalLimit,
                           boolean bounded,
                           long consumed)
    • Method Detail

      • initialRestriction

        public static OffsetRestrictionTracker.OffsetRange initialRestriction​(long limit,
                                                                              boolean bounded)
        Parameters:
        limit - total limit to read
        bounded - true if this is bounded restriction
        Returns:
        initial restriction for DoFn.GetInitialRestriction.*
      • getPartition

        public Partition getPartition()
      • isLimitConsumed

        public boolean isLimitConsumed()
      • 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()
      • 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 class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object