Interface WindowConfig

  • All Known Implementing Classes:
    CountWindowConfig, CustomWindowConfig, TimeWindowConfig

    public interface WindowConfig
    WindowConfig allows Streamlet API users to program window configuration for operations that rely on windowing. Currently we only support time/count based sliding/tumbling windows.
    • Method Detail

      • applyTo

        void applyTo​(BaseWindowedBolt bolt)
        Apply this WindowConfig object to a bolt object
        Parameters:
        bolt - the target bolt object
      • Dummy

        void Dummy()
        This is just a dummy function to avoid WindowConfig objects to be matched with Java functional interface and cause ambiguous reference compiling error. In case new virtual functions are needed in WindowConfig, this dummy function can be safely removed.
      • TumblingTimeWindow

        static WindowConfig TumblingTimeWindow​(Duration windowDuration)
        Creates a time based tumbling window of windowDuration
        Parameters:
        windowDuration - the duration of the tumbling window
        Returns:
        WindowConfig that can be passed to the transformation
      • SlidingTimeWindow

        static WindowConfig SlidingTimeWindow​(Duration windowDuration,
                                              Duration slideInterval)
        Creates a time based sliding window with windowDuration as the window duration and slideInterval as slideInterval
        Parameters:
        windowDuration - The Sliding Window duration
        slideInterval - The sliding duration
        Returns:
        WindowConfig that can be passed to the transformation
      • TumblingCountWindow

        static WindowConfig TumblingCountWindow​(int windowSize)
        Creates a count based tumbling window of size windowSize
        Parameters:
        windowSize - the size of the tumbling window
        Returns:
        WindowConfig that can be passed to the transformation
      • SlidingCountWindow

        static WindowConfig SlidingCountWindow​(int windowSize,
                                               int slideSize)
        Creates a count based sliding window with windowSize as the window countsize and slideSize as slide size
        Parameters:
        windowSize - The Window Count Size
        slideSize - The slide size
        Returns:
        WindowConfig that can be passed to the transformation
      • CustomWindow

        static WindowConfig CustomWindow​(TriggerPolicy<Tuple,​?> triggerPolicy,
                                         EvictionPolicy<Tuple,​?> evictionPolicy)
        Creates a window based on the provided custom trigger and eviction policies
        Parameters:
        triggerPolicy - The trigger policy to use
        evictionPolicy - The eviction policy to use
        Returns:
        WindowConfig that can be passed to the transformation