public static class UnsliceAssigners.SessionUnsliceAssigner extends Object implements UnsliceAssigner<TimeWindow>
UnsliceAssigner
for session windows.Constructor and Description |
---|
SessionUnsliceAssigner(int rowtimeIndex,
java.time.ZoneId shiftTimeZone,
long sessionGap) |
Modifier and Type | Method and Description |
---|---|
Optional<TimeWindow> |
assignActualWindow(RowData element,
ClockService clock,
MergingWindowProcessFunction<?,TimeWindow> windowFunction)
Returns the
Window that the given element should belong to be used to trigger on. |
Optional<TimeWindow> |
assignStateNamespace(RowData element,
ClockService clock,
MergingWindowProcessFunction<?,TimeWindow> windowFunction)
Returns the
Window that the given element should belong to be used as a namespace to
restore the state. |
String |
getDescription()
Returns a description of this window assigner.
|
MergingWindowAssigner<TimeWindow> |
getMergingWindowAssigner()
Currently, unslice assigner has an inner
MergingWindowAssigner to reuse the logic in
GroupWindowAssigner to
merge windows. |
protected long |
getUtcTimestamp(RowData element,
ClockService clock) |
boolean |
isEventTime()
Returns
true if elements are assigned to windows based on event time, false
based on processing time. |
public SessionUnsliceAssigner(int rowtimeIndex, java.time.ZoneId shiftTimeZone, long sessionGap)
public MergingWindowAssigner<TimeWindow> getMergingWindowAssigner()
UnsliceAssigner
MergingWindowAssigner
to reuse the logic in
GroupWindowAssigner
to
merge windows.getMergingWindowAssigner
in interface UnsliceAssigner<TimeWindow>
public Optional<TimeWindow> assignActualWindow(RowData element, ClockService clock, MergingWindowProcessFunction<?,TimeWindow> windowFunction) throws Exception
UnsliceAssigner
Window
that the given element should belong to be used to trigger on.
See more details in MergingWindowProcessFunction.assignActualWindows(org.apache.flink.table.data.RowData, long)
.
assignActualWindow
in interface UnsliceAssigner<TimeWindow>
element
- the element to which slice should belong to.clock
- the service to get current processing time.Exception
public Optional<TimeWindow> assignStateNamespace(RowData element, ClockService clock, MergingWindowProcessFunction<?,TimeWindow> windowFunction) throws Exception
UnsliceAssigner
Window
that the given element should belong to be used as a namespace to
restore the state.
See more details in MergingWindowProcessFunction.assignStateNamespace(org.apache.flink.table.data.RowData, long)
.
assignStateNamespace
in interface UnsliceAssigner<TimeWindow>
element
- the element to which slice should belong to.clock
- the service to get current processing time.Exception
protected long getUtcTimestamp(RowData element, ClockService clock)
public boolean isEventTime()
WindowAssigner
true
if elements are assigned to windows based on event time, false
based on processing time.isEventTime
in interface WindowAssigner
public String getDescription()
WindowAssigner
getDescription
in interface WindowAssigner
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.