Interface Evictor<T,W extends Window>
- Type Parameters:
T- The type of elements that thisEvictorcan evict.W- The type ofWindowson which thisEvictorcan operate.
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
CountEvictor
An
Evictor can remove elements from a pane before/after the evaluation of WindowFunction
and after the window evaluation gets triggered by a Trigger
A pane is the bucket of elements that have the same key (assigned by the KeySelector) and same Window. An element can be in
multiple panes of it was assigned to multiple windows by the WindowAssigner. These panes all have their
own instance of the Evictor.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA context object that is given toEvictormethods. -
Method Summary
Modifier and TypeMethodDescriptionvoidevictAfter(Iterable<TimestampedValue<T>> elements, int size, W window, Evictor.EvictorContext evictorContext) Optionally evicts elements.voidevictBefore(Iterable<TimestampedValue<T>> elements, int size, W window, Evictor.EvictorContext evictorContext) Optionally evicts elements.
-
Method Details
-
evictBefore
void evictBefore(Iterable<TimestampedValue<T>> elements, int size, W window, Evictor.EvictorContext evictorContext) Optionally evicts elements. Called before windowing function.- Parameters:
elements- The elements currently in the pane.size- The current number of elements in the pane.window- TheWindowevictorContext- The context for the Evictor
-
evictAfter
void evictAfter(Iterable<TimestampedValue<T>> elements, int size, W window, Evictor.EvictorContext evictorContext) Optionally evicts elements. Called after windowing function.- Parameters:
elements- The elements currently in the pane.size- The current number of elements in the pane.window- TheWindowevictorContext- The context for the Evictor
-