W
- The type of Windows
on which this Evictor
can operate.@PublicEvolving public class TimeEvictor<W extends Window> extends Object implements Evictor<Object,W>
Evictor
that keeps elements for a certain amount of time. Elements older
than current_time - keep_time
are evicted.Constructor and Description |
---|
TimeEvictor(long windowSize) |
Modifier and Type | Method and Description |
---|---|
int |
evict(Iterable<StreamRecord<Object>> elements,
int size,
W window)
Computes how many elements should be removed from the pane.
|
long |
getWindowSize() |
static <W extends Window> |
of(Time windowSize)
Creates a
TimeEvictor that keeps the given number of elements. |
String |
toString() |
public int evict(Iterable<StreamRecord<Object>> elements, int size, W window)
Evictor
public long getWindowSize()
public static <W extends Window> TimeEvictor<W> of(Time windowSize)
TimeEvictor
that keeps the given number of elements.windowSize
- The amount of time for which to keep elements.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.