Package org.apache.kafka.streams.kstream
Interface EmitStrategy
public interface EmitStrategy
This interface controls the strategy that can be used to control how we emit results in a processor.
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic EmitStrategy
This strategy indicates that the aggregated result for a window will only be emitted when the window closes instead of when there's an update to the window.static EmitStrategy
This strategy indicates that the aggregated result for a window will be emitted every time when there's an update to the window instead of when the window closes.type()
Returns the strategy type.
-
Field Details
-
log
static final org.slf4j.Logger log
-
-
Method Details
-
type
EmitStrategy.StrategyType type()Returns the strategy type.- Returns:
- Emit strategy type
-
onWindowClose
This strategy indicates that the aggregated result for a window will only be emitted when the window closes instead of when there's an update to the window. Window close means that current event time is larger than (window end time + grace period).This strategy should only be used for windows which can close. An exception will be thrown if it's used with
UnlimitedWindow
.- Returns:
- "window close"
EmitStrategy
instance - See Also:
-
TimeWindows
SlidingWindows
SessionWindows
UnlimitedWindows
WindowUpdateStrategy
-
onWindowUpdate
This strategy indicates that the aggregated result for a window will be emitted every time when there's an update to the window instead of when the window closes.- Returns:
- "window update"
EmitStrategy
instance - See Also:
-
TimeWindows
SlidingWindows
SessionWindows
UnlimitedWindows
WindowCloseStrategy
-