Enum TimestampCombiner

    • Enum Constant Detail

      • EARLIEST

        public static final TimestampCombiner EARLIEST
        The policy of taking at the earliest of a set of timestamps.

        When used in windowed aggregations, the timestamps of non-late inputs will be combined after they are shifted by the WindowFn (to allow downstream watermark progress).

        If data arrives late, it has no effect on the output timestamp.

      • LATEST

        public static final TimestampCombiner LATEST
        The policy of taking the latest of a set of timestamps.

        When used in windowed aggregations, the timestamps of non-late inputs will be combined after they are shifted by the WindowFn (to allow downstream watermark progress).

        If data arrives late, it has no effect on the output timestamp.

      • END_OF_WINDOW

        public static final TimestampCombiner END_OF_WINDOW
        The policy of using the end of the window, regardless of input timestamps.

        When used in windowed aggregations, the timestamps of non-late inputs will be combined after they are shifted by the WindowFn (to allow downstream watermark progress).

        If data arrives late, it has no effect on the output timestamp.

    • Method Detail

      • values

        public static TimestampCombiner[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (TimestampCombiner c : TimestampCombiner.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static TimestampCombiner valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • merge

        public abstract org.joda.time.Instant merge​(BoundedWindow intoWindow,
                                                    java.lang.Iterable<? extends org.joda.time.Instant> mergingTimestamps)
        Merges the given timestamps, which may have originated in separate windows, into the context of the result window.
      • dependsOnlyOnEarliestTimestamp

        public abstract boolean dependsOnlyOnEarliestTimestamp()
        Returns true if the result of combination of many output timestamps actually depends only on the earliest.

        This may allow optimizations when it is very efficient to retrieve the earliest timestamp to be combined.

      • dependsOnlyOnWindow

        public abstract boolean dependsOnlyOnWindow()
        Returns true if the result does not depend on what outputs were combined but only the window they are in. The canonical example is if all timestamps are sure to be the end of the window.

        This may allow optimizations, since it is typically very efficient to retrieve the window and combining output timestamps is not necessary.