public class CountTumblingWindowAssigner extends WindowAssigner<CountWindow>
WindowAssigner
that windows elements into fixed-size windows
based on the count number of the elements. Windows cannot overlap.Modifier and Type | Method and Description |
---|---|
Collection<CountWindow> |
assignWindows(BaseRow element,
long timestamp)
Given the timestamp and element, returns the set of windows into which it
should be placed.
|
TypeSerializer<CountWindow> |
getWindowSerializer(ExecutionConfig executionConfig)
Returns a
TypeSerializer for serializing windows that are assigned by
this WindowAssigner . |
boolean |
isEventTime()
Returns
true if elements are assigned to windows based on event time,
false otherwise. |
static CountTumblingWindowAssigner |
of(long size) |
void |
open(InternalWindowProcessFunction.Context<?,CountWindow> ctx)
Initialization method for the function.
|
String |
toString() |
public void open(InternalWindowProcessFunction.Context<?,CountWindow> ctx) throws Exception
WindowAssigner
open
in class WindowAssigner<CountWindow>
Exception
public Collection<CountWindow> assignWindows(BaseRow element, long timestamp) throws IOException
WindowAssigner
assignWindows
in class WindowAssigner<CountWindow>
element
- The element to which windows should be assigned.timestamp
- The timestamp of the element when WindowAssigner.isEventTime()
returns true,
or the current system time when WindowAssigner.isEventTime()
returns false.IOException
public TypeSerializer<CountWindow> getWindowSerializer(ExecutionConfig executionConfig)
WindowAssigner
TypeSerializer
for serializing windows that are assigned by
this WindowAssigner
.getWindowSerializer
in class WindowAssigner<CountWindow>
public boolean isEventTime()
WindowAssigner
true
if elements are assigned to windows based on event time,
false
otherwise.isEventTime
in class WindowAssigner<CountWindow>
public String toString()
toString
in class WindowAssigner<CountWindow>
public static CountTumblingWindowAssigner of(long size)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.