Class DeltaEvictor<T,W extends org.apache.flink.streaming.api.windowing.windows.Window>
- java.lang.Object
-
- org.apache.flink.streaming.api.windowing.evictors.DeltaEvictor<T,W>
-
- Type Parameters:
W- The type ofWindowson which thisEvictorcan operate.
- All Implemented Interfaces:
Serializable,org.apache.flink.streaming.api.windowing.evictors.Evictor<T,W>
@PublicEvolving public class DeltaEvictor<T,W extends org.apache.flink.streaming.api.windowing.windows.Window> extends Object implements org.apache.flink.streaming.api.windowing.evictors.Evictor<T,W>
AnEvictorthat keeps elements based on aDeltaFunctionand a threshold.Eviction starts from the first element of the buffer and removes all elements from the buffer which have a higher delta then the threshold.
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidevictAfter(Iterable<org.apache.flink.streaming.runtime.operators.windowing.TimestampedValue<T>> elements, int size, W window, org.apache.flink.streaming.api.windowing.evictors.Evictor.EvictorContext ctx)voidevictBefore(Iterable<org.apache.flink.streaming.runtime.operators.windowing.TimestampedValue<T>> elements, int size, W window, org.apache.flink.streaming.api.windowing.evictors.Evictor.EvictorContext ctx)static <T,W extends org.apache.flink.streaming.api.windowing.windows.Window>
DeltaEvictor<T,W>of(double threshold, DeltaFunction<T> deltaFunction)Creates aDeltaEvictorfrom the given threshold andDeltaFunction.static <T,W extends org.apache.flink.streaming.api.windowing.windows.Window>
DeltaEvictor<T,W>of(double threshold, DeltaFunction<T> deltaFunction, boolean doEvictAfter)Creates aDeltaEvictorfrom the given threshold,DeltaFunction.StringtoString()
-
-
-
Method Detail
-
evictBefore
public void evictBefore(Iterable<org.apache.flink.streaming.runtime.operators.windowing.TimestampedValue<T>> elements, int size, W window, org.apache.flink.streaming.api.windowing.evictors.Evictor.EvictorContext ctx)
-
evictAfter
public void evictAfter(Iterable<org.apache.flink.streaming.runtime.operators.windowing.TimestampedValue<T>> elements, int size, W window, org.apache.flink.streaming.api.windowing.evictors.Evictor.EvictorContext ctx)
-
of
public static <T,W extends org.apache.flink.streaming.api.windowing.windows.Window> DeltaEvictor<T,W> of(double threshold, DeltaFunction<T> deltaFunction)
Creates aDeltaEvictorfrom the given threshold andDeltaFunction. Eviction is done before the window function.- Parameters:
threshold- The thresholddeltaFunction- TheDeltaFunction
-
of
public static <T,W extends org.apache.flink.streaming.api.windowing.windows.Window> DeltaEvictor<T,W> of(double threshold, DeltaFunction<T> deltaFunction, boolean doEvictAfter)
Creates aDeltaEvictorfrom the given threshold,DeltaFunction. Eviction is done before/after the window function based on the value of doEvictAfter.- Parameters:
threshold- The thresholddeltaFunction- TheDeltaFunctiondoEvictAfter- Whether eviction should be done after window function
-
-