Interface Window<T>

  • Type Parameters:
    T - the type of event that this window contains.
    All Known Implementing Classes:
    WindowImpl

    public interface Window<T>
    A view of events in a sliding window.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.List<T> get()
      Gets the list of events in the window.
      java.lang.Long getEndTimestamp()
      If processing based on event time, returns the window end time based on watermark otherwise returns the window end time based on processing time.
      java.util.List<T> getExpired()
      Get the list of events expired from the window since the last time the window was generated.
      java.util.List<T> getNew()
      Get the list of newly added events in the window since the last time the window was generated.
      java.lang.Long getStartTimestamp()
      Returns the window start timestamp.
    • Method Detail

      • get

        java.util.List<T> get()
        Gets the list of events in the window.

        Note: If the number of tuples in windows is huge, invoking get would load all the tuples into memory and may throw an OOM exception. Use windowing with persistence

        Returns:
        the list of events in the window.
      • getNew

        java.util.List<T> getNew()
        Get the list of newly added events in the window since the last time the window was generated.
        Returns:
        the list of newly added events in the window.
      • getExpired

        java.util.List<T> getExpired()
        Get the list of events expired from the window since the last time the window was generated.
        Returns:
        the list of events expired from the window.
      • getEndTimestamp

        java.lang.Long getEndTimestamp()
        If processing based on event time, returns the window end time based on watermark otherwise returns the window end time based on processing time.
        Returns:
        the window end timestamp
      • getStartTimestamp

        java.lang.Long getStartTimestamp()
        Returns the window start timestamp. Will return null if the window length is not based on time duration.
        Returns:
        the window start timestamp or null if the window length is not time based