Class KeyedWindowResult<K,​R>

  • Type Parameters:
    K - type of the grouping key
    R - type of the aggregated result
    All Implemented Interfaces:
    java.util.Map.Entry<K,​R>

    public final class KeyedWindowResult<K,​R>
    extends WindowResult<R>
    implements java.util.Map.Entry<K,​R>
    Holds the result of a group-and-aggregate operation performed over a time window.
    Since:
    Jet 3.0
    • Constructor Detail

      • KeyedWindowResult

        public KeyedWindowResult​(long start,
                                 long end,
                                 @Nonnull
                                 K key,
                                 @Nonnull
                                 R result,
                                 boolean isEarly)
        Parameters:
        start - start time of the window
        end - end time of the window
        key - grouping key
        result - result of aggregation
        isEarly - whether this is an early result, to be followed by the final one
      • KeyedWindowResult

        public KeyedWindowResult​(long start,
                                 long end,
                                 @Nonnull
                                 K key,
                                 @Nonnull
                                 R result)
        Constructs a keyed window result that is not early.
        Parameters:
        start - start time of the window
        end - end time of the window
        key - grouping key
        result - result of aggregation
    • Method Detail

      • key

        @Nonnull
        public K key()
        Returns the grouping key.
      • getKey

        public K getKey()
        Alias for key, implements Map.Entry.
        Specified by:
        getKey in interface java.util.Map.Entry<K,​R>
      • getValue

        public R getValue()
        Alias for WindowResult.result(), implements Map.Entry.
        Specified by:
        getValue in interface java.util.Map.Entry<K,​R>
      • setValue

        public R setValue​(R value)
        Implements Map.Entry, throws UnsupportedOperationException.
        Specified by:
        setValue in interface java.util.Map.Entry<K,​R>
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface java.util.Map.Entry<K,​R>
        Overrides:
        equals in class WindowResult<R>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map.Entry<K,​R>
        Overrides:
        hashCode in class WindowResult<R>