Class JoinWindows

    • Field Detail

      • beforeMs

        public final long beforeMs
        Maximum time difference for tuples that are before the join tuple.
      • afterMs

        public final long afterMs
        Maximum time difference for tuples that are after the join tuple.
    • Method Detail

      • of

        @Deprecated
        public static JoinWindows of​(long timeDifferenceMs)
                              throws IllegalArgumentException
        Deprecated.
        Use of(Duration) instead.
        Specifies that records of the same key are joinable if their timestamps are within timeDifferenceMs, i.e., the timestamp of a record from the secondary stream is max timeDifferenceMs earlier or later than the timestamp of the record from the primary stream.
        Parameters:
        timeDifferenceMs - join window interval in milliseconds
        Throws:
        IllegalArgumentException - if timeDifferenceMs is negative
      • of

        public static JoinWindows of​(Duration timeDifference)
                              throws IllegalArgumentException
        Specifies that records of the same key are joinable if their timestamps are within timeDifference, i.e., the timestamp of a record from the secondary stream is max timeDifference earlier or later than the timestamp of the record from the primary stream.
        Parameters:
        timeDifference - join window interval
        Throws:
        IllegalArgumentException - if timeDifference is negative or can't be represented as long milliseconds
      • before

        @Deprecated
        public JoinWindows before​(long timeDifferenceMs)
                           throws IllegalArgumentException
        Deprecated.
        Use before(Duration) instead.
        Changes the start window boundary to timeDifferenceMs but keep the end window boundary as is. Thus, records of the same key are joinable if the timestamp of a record from the secondary stream is at most timeDifferenceMs earlier than the timestamp of the record from the primary stream. timeDifferenceMs can be negative but its absolute value must not be larger than current window "after" value (which would result in a negative window size).
        Parameters:
        timeDifferenceMs - relative window start time in milliseconds
        Throws:
        IllegalArgumentException - if the resulting window size is negative
      • before

        public JoinWindows before​(Duration timeDifference)
                           throws IllegalArgumentException
        Changes the start window boundary to timeDifference but keep the end window boundary as is. Thus, records of the same key are joinable if the timestamp of a record from the secondary stream is at most timeDifference earlier than the timestamp of the record from the primary stream. timeDifference can be negative but its absolute value must not be larger than current window "after" value (which would result in a negative window size).
        Parameters:
        timeDifference - relative window start time
        Throws:
        IllegalArgumentException - if the resulting window size is negative or timeDifference can't be represented as long milliseconds
      • after

        @Deprecated
        public JoinWindows after​(long timeDifferenceMs)
                          throws IllegalArgumentException
        Deprecated.
        Use after(Duration) instead
        Changes the end window boundary to timeDifferenceMs but keep the start window boundary as is. Thus, records of the same key are joinable if the timestamp of a record from the secondary stream is at most timeDifferenceMs later than the timestamp of the record from the primary stream. timeDifferenceMs can be negative but its absolute value must not be larger than current window "before" value (which would result in a negative window size).
        Parameters:
        timeDifferenceMs - relative window end time in milliseconds
        Throws:
        IllegalArgumentException - if the resulting window size is negative
      • after

        public JoinWindows after​(Duration timeDifference)
                          throws IllegalArgumentException
        Changes the end window boundary to timeDifference but keep the start window boundary as is. Thus, records of the same key are joinable if the timestamp of a record from the secondary stream is at most timeDifference later than the timestamp of the record from the primary stream. timeDifference can be negative but its absolute value must not be larger than current window "before" value (which would result in a negative window size).
        Parameters:
        timeDifference - relative window end time
        Throws:
        IllegalArgumentException - if the resulting window size is negative or timeDifference can't be represented as long milliseconds
      • size

        public long size()
        Description copied from class: Windows
        Return the size of the specified windows in milliseconds.
        Specified by:
        size in class Windows<Window>
        Returns:
        the size of the specified windows
      • grace

        public JoinWindows grace​(Duration afterWindowEnd)
                          throws IllegalArgumentException
        Reject out-of-order events that are delayed more than afterWindowEnd after the end of its window.

        Delay is defined as (stream_time - record_timestamp).

        Parameters:
        afterWindowEnd - The grace period to admit out-of-order events to a window.
        Returns:
        this updated builder
        Throws:
        IllegalArgumentException - if the afterWindowEnd is negative of can't be represented as long milliseconds
      • gracePeriodMs

        public long gracePeriodMs()
        Description copied from class: Windows
        Return the window grace period (the time to admit out-of-order events after the end of the window.) Delay is defined as (stream_time - record_timestamp).
        Specified by:
        gracePeriodMs in class Windows<Window>
      • until

        @Deprecated
        public JoinWindows until​(long durationMs)
                          throws IllegalArgumentException
        Deprecated.
        since 2.1. Use grace(Duration) instead.
        Description copied from class: Windows
        Set the window maintain duration (retention time) in milliseconds. This retention time is a guaranteed lower bound for how long a window will be maintained.
        Overrides:
        until in class Windows<Window>
        Parameters:
        durationMs - the window retention time in milliseconds
        Returns:
        itself
        Throws:
        IllegalArgumentException - if durationMs is smaller than the window size
      • maintainMs

        @Deprecated
        public long maintainMs()
        Deprecated.
        since 2.1. This function should not be used anymore, since until(long) is deprecated in favor of grace(Duration).
        Return the window maintain duration (retention time) in milliseconds.

        For TimeWindows the maintain duration is at least as small as the window size.

        Overrides:
        maintainMs in class Windows<Window>
        Returns:
        the window maintain duration
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object