Package org.apache.heron.streamlet
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 Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
applyTo(BaseWindowedBolt bolt)
Apply this WindowConfig object to a bolt objectstatic WindowConfig
CustomWindow(TriggerPolicy<Tuple,?> triggerPolicy, EvictionPolicy<Tuple,?> evictionPolicy)
Creates a window based on the provided custom trigger and eviction policiesvoid
Dummy()
This is just a dummy function to avoid WindowConfig objects to be matched with Java functional interface and cause ambiguous reference compiling error.static WindowConfig
SlidingCountWindow(int windowSize, int slideSize)
Creates a count based sliding window with windowSize as the window countsize and slideSize as slide sizestatic WindowConfig
SlidingTimeWindow(Duration windowDuration, Duration slideInterval)
Creates a time based sliding window with windowDuration as the window duration and slideInterval as slideIntervalstatic WindowConfig
TumblingCountWindow(int windowSize)
Creates a count based tumbling window of size windowSizestatic WindowConfig
TumblingTimeWindow(Duration windowDuration)
Creates a time based tumbling window of windowDuration
-
-
-
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 durationslideInterval
- 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 SizeslideSize
- 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 useevictionPolicy
- The eviction policy to use- Returns:
- WindowConfig that can be passed to the transformation
-
-