W - The type of Windows on which this Evictor can operate.@PublicEvolving public class DeltaEvictor<T,W extends Window> extends Object implements Evictor<T,W>
Evictor that keeps elements based on a DeltaFunction and 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.
Evictor.EvictorContext| Modifier and Type | Method and Description |
|---|---|
void |
evictAfter(Iterable<TimestampedValue<T>> elements,
int size,
W window,
Evictor.EvictorContext ctx)
Optionally evicts elements.
|
void |
evictBefore(Iterable<TimestampedValue<T>> elements,
int size,
W window,
Evictor.EvictorContext ctx)
Optionally evicts elements.
|
static <T,W extends Window> |
of(double threshold,
DeltaFunction<T> deltaFunction)
Creates a
DeltaEvictor from the given threshold and DeltaFunction. |
static <T,W extends Window> |
of(double threshold,
DeltaFunction<T> deltaFunction,
boolean doEvictAfter)
Creates a
DeltaEvictor from the given threshold, DeltaFunction. |
String |
toString() |
public void evictBefore(Iterable<TimestampedValue<T>> elements, int size, W window, Evictor.EvictorContext ctx)
Evictorpublic void evictAfter(Iterable<TimestampedValue<T>> elements, int size, W window, Evictor.EvictorContext ctx)
Evictorpublic static <T,W extends Window> DeltaEvictor<T,W> of(double threshold, DeltaFunction<T> deltaFunction)
DeltaEvictor from the given threshold and DeltaFunction.
Eviction is done before the window function.threshold - The thresholddeltaFunction - The DeltaFunctionpublic static <T,W extends Window> DeltaEvictor<T,W> of(double threshold, DeltaFunction<T> deltaFunction, boolean doEvictAfter)
DeltaEvictor from the given threshold, DeltaFunction.
Eviction is done before/after the window function based on the value of doEvictAfter.threshold - The thresholddeltaFunction - The DeltaFunctiondoEvictAfter - Whether eviction should be done after window functionCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.