Class CountEvictor<W extends Window>

    • Method Detail

      • evictBefore

        public void evictBefore​(Iterable<TimestampedValue<Object>> elements,
                                int size,
                                W window,
                                Evictor.EvictorContext ctx)
        Description copied from interface: Evictor
        Optionally evicts elements. Called before windowing function.
        Specified by:
        evictBefore in interface Evictor<Object,​W extends Window>
        Parameters:
        elements - The elements currently in the pane.
        size - The current number of elements in the pane.
        window - The Window
        ctx - The context for the Evictor
      • evictAfter

        public void evictAfter​(Iterable<TimestampedValue<Object>> elements,
                               int size,
                               W window,
                               Evictor.EvictorContext ctx)
        Description copied from interface: Evictor
        Optionally evicts elements. Called after windowing function.
        Specified by:
        evictAfter in interface Evictor<Object,​W extends Window>
        Parameters:
        elements - The elements currently in the pane.
        size - The current number of elements in the pane.
        window - The Window
        ctx - The context for the Evictor
      • of

        public static <W extends WindowCountEvictor<W> of​(long maxCount)
        Creates a CountEvictor that keeps the given number of elements. Eviction is done before the window function.
        Parameters:
        maxCount - The number of elements to keep in the pane.
      • of

        public static <W extends WindowCountEvictor<W> 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.
        Parameters:
        maxCount - The number of elements to keep in the pane.
        doEvictAfter - Whether to do eviction after the window function.