Interface KeyedWindowResultFunction<K,​R,​OUT>

  • Type Parameters:
    K - type of the key
    R - the type of aggregation result this function receives
    OUT - the type of the output item this function returns
    All Superinterfaces:
    java.io.Serializable
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface KeyedWindowResultFunction<K,​R,​OUT>
    extends java.io.Serializable
    Represents the function you pass to windowing processors such as aggregateToSlidingWindowP() and aggregateToSessionWindowP() as mapToOutputFn. It creates the item to emit based on the results of a single aggregate operation performed for a particular window and a particular grouping key.
    Since:
    Jet 3.0
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      OUT apply​(long winStart, long winEnd, K key, R windowResult, boolean isEarly)
      Applies the function to the given arguments
    • Method Detail

      • apply

        @Nullable
        OUT apply​(long winStart,
                  long winEnd,
                  @Nonnull
                  K key,
                  @Nonnull
                  R windowResult,
                  boolean isEarly)
        Applies the function to the given arguments
        Parameters:
        winStart - the inclusive lower timestamp of the window
        winEnd - the exclusive upper timestamp of the window
        key - the grouping key
        windowResult - the result of the aggregate operation
        isEarly - whether the result is an early result as specified by WindowDefinition.setEarlyResultsPeriod(long)
        Returns:
        the function result