jingz-db commented on code in PR #47878:
URL: https://github.com/apache/spark/pull/47878#discussion_r1815576699
##########
python/pyspark/sql/streaming/stateful_processor.py:
##########
@@ -180,6 +234,24 @@ def getListState(
self.stateful_processor_api_client.get_list_state(state_name, schema,
ttl_duration_ms)
return ListState(ListStateClient(self.stateful_processor_api_client),
state_name, schema)
+ def registerTimer(self, expiry_time_stamp_ms: int) -> None:
+ """
+ Register a timer for a given expiry timestamp in milliseconds for the
grouping key.
+ """
+ self.stateful_processor_api_client.register_timer(expiry_time_stamp_ms)
+
+ def deleteTimer(self, expiry_time_stamp_ms: int) -> None:
+ """
+ Delete a timer for a given expiry timestamp in milliseconds for the
grouping key.
+ """
+ self.stateful_processor_api_client.delete_timer(expiry_time_stamp_ms)
+
+ def listTimers(self) -> Iterator[list[int]]:
Review Comment:
The interface is a bit misleading; Will refactor this to `Iterator[int]`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]