W
- The type of Windows
on which this Evictor
can operate.@PublicEvolving public class CountEvictor<W extends Window> extends Object implements Evictor<Object,W>
Evictor
that keeps up to a certain amount of elements.Evictor.EvictorContext
Modifier and Type | Method and Description |
---|---|
void |
evictAfter(Iterable<TimestampedValue<Object>> elements,
int size,
W window,
Evictor.EvictorContext ctx)
Optionally evicts elements.
|
void |
evictBefore(Iterable<TimestampedValue<Object>> elements,
int size,
W window,
Evictor.EvictorContext ctx)
Optionally evicts elements.
|
static <W extends Window> |
of(long maxCount)
Creates a
CountEvictor that keeps the given number of elements. |
static <W extends Window> |
of(long maxCount,
boolean doEvictAfter)
Creates a
CountEvictor that keeps the given number of elements in the pane Eviction
is done before/after the window function based on the value of doEvictAfter. |
public void evictBefore(Iterable<TimestampedValue<Object>> elements, int size, W window, Evictor.EvictorContext ctx)
Evictor
public void evictAfter(Iterable<TimestampedValue<Object>> elements, int size, W window, Evictor.EvictorContext ctx)
Evictor
public static <W extends Window> CountEvictor<W> of(long maxCount)
CountEvictor
that keeps the given number of elements. Eviction is done
before the window function.maxCount
- The number of elements to keep in the pane.public static <W extends Window> CountEvictor<W> of(long maxCount, boolean doEvictAfter)
CountEvictor
that keeps the given number of elements in the pane Eviction
is done before/after the window function based on the value of doEvictAfter.maxCount
- The number of elements to keep in the pane.doEvictAfter
- Whether to do eviction after the window function.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.