Package org.apache.spark.sql.streaming
Class GroupStateTimeout
Object
org.apache.spark.sql.streaming.GroupStateTimeout
Represents the type of timeouts possible for the Dataset operations
mapGroupsWithState
and flatMapGroupsWithState
.
See documentation on GroupState
for more details.
- Since:
- 2.2.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic GroupStateTimeout
Timeout based on event-time.static GroupStateTimeout
No timeout.static GroupStateTimeout
Timeout based on processing time.
-
Constructor Details
-
GroupStateTimeout
public GroupStateTimeout()
-
-
Method Details
-
ProcessingTimeTimeout
Timeout based on processing time.The duration of timeout can be set for each group in
map/flatMapGroupsWithState
by callingGroupState.setTimeoutDuration()
.See documentation on
GroupState
for more details. -
EventTimeTimeout
Timeout based on event-time.The event-time timestamp for timeout can be set for each group in
map/flatMapGroupsWithState
by callingGroupState.setTimeoutTimestamp()
. In addition, you have to define the watermark in the query usingDataset.withWatermark
. When the watermark advances beyond the set timestamp of a group and the group has not received any data, then the group times out.See documentation on
GroupState
for more details. -
NoTimeout
No timeout.
-