@@ -156,7 +156,7 @@ def __init__(
156
156
topic_create_timeout : float = 60 ,
157
157
processing_guarantee : ProcessingGuarantee = "at-least-once" ,
158
158
max_partition_buffer_size : int = 10000 ,
159
- heartbeat_interval : float = 0.0 ,
159
+ wall_clock_interval : float = 0.0 ,
160
160
):
161
161
"""
162
162
:param broker_address: Connection settings for Kafka.
@@ -226,11 +226,11 @@ def __init__(
226
226
It is a soft limit, and the actual number of buffered messages can be up to x2 higher.
227
227
Lower value decreases the memory use, but increases the latency.
228
228
Default - `10000`.
229
- :param heartbeat_interval : the interval (seconds) at which to send heartbeat messages.
230
- The heartbeat timing starts counting from application start .
231
- TODO: Save and respect last heartbeat timestamp .
232
- The heartbeat is sent for every partition of every topic with registered heartbeat streams .
233
- If the value is 0, no heartbeat messages will be sent .
229
+ :param wall_clock_interval : the interval (seconds) at which to invoke
230
+ the registered wall clock logic .
231
+ The wall clock timing starts counting from application start .
232
+ TODO: Save and respect last wall clock timestamp .
233
+ If the value is 0, no wall clock logic will be invoked .
234
234
Default - `0.0`.
235
235
236
236
<br><br>***Error Handlers***<br>
@@ -380,9 +380,9 @@ def __init__(
380
380
recovery_manager = recovery_manager ,
381
381
)
382
382
383
- self ._heartbeat_active = heartbeat_interval > 0
384
- self ._heartbeat_interval = heartbeat_interval
385
- self ._heartbeat_last_sent = datetime .now ().timestamp ()
383
+ self ._wall_clock_active = wall_clock_interval > 0
384
+ self ._wall_clock_interval = wall_clock_interval
385
+ self ._wall_clock_last_sent = datetime .now ().timestamp ()
386
386
387
387
self ._source_manager = SourceManager ()
388
388
self ._sink_manager = SinkManager ()
@@ -913,7 +913,7 @@ def _run_dataframe(self, sink: Optional[VoidExecutor] = None):
913
913
processing_context = self ._processing_context
914
914
source_manager = self ._source_manager
915
915
process_message = self ._process_message
916
- process_heartbeat = self ._process_heartbeat
916
+ process_wall_clock = self ._process_wall_clock
917
917
printer = self ._processing_context .printer
918
918
run_tracker = self ._run_tracker
919
919
consumer = self ._consumer
@@ -926,9 +926,9 @@ def _run_dataframe(self, sink: Optional[VoidExecutor] = None):
926
926
)
927
927
928
928
dataframes_composed = self ._dataframe_registry .compose_all (sink = sink )
929
- heartbeats_composed = self ._dataframe_registry .compose_heartbeats ()
930
- if not heartbeats_composed :
931
- self ._heartbeat_active = False
929
+ wall_clock_executors = self ._dataframe_registry .compose_wall_clock ()
930
+ if not wall_clock_executors :
931
+ self ._wall_clock_active = False
932
932
933
933
processing_context .init_checkpoint ()
934
934
run_tracker .set_as_running ()
@@ -940,7 +940,7 @@ def _run_dataframe(self, sink: Optional[VoidExecutor] = None):
940
940
run_tracker .timeout_refresh ()
941
941
else :
942
942
process_message (dataframes_composed )
943
- process_heartbeat ( heartbeats_composed )
943
+ process_wall_clock ( wall_clock_executors )
944
944
processing_context .commit_checkpoint ()
945
945
consumer .resume_backpressured ()
946
946
source_manager .raise_for_error ()
@@ -1024,18 +1024,18 @@ def _process_message(self, dataframe_composed):
1024
1024
if self ._on_message_processed is not None :
1025
1025
self ._on_message_processed (topic_name , partition , offset )
1026
1026
1027
- def _process_heartbeat (self , heartbeats_composed ):
1028
- if not self ._heartbeat_active :
1027
+ def _process_wall_clock (self , wall_clock_executors ):
1028
+ if not self ._wall_clock_active :
1029
1029
return
1030
1030
1031
1031
now = datetime .now ().timestamp ()
1032
- if self ._heartbeat_last_sent > now - self ._heartbeat_interval :
1032
+ if self ._wall_clock_last_sent > now - self ._wall_clock_interval :
1033
1033
return
1034
1034
1035
1035
value , key , timestamp , headers = None , None , int (now * 1000 ), {}
1036
1036
1037
1037
for tp in self ._consumer .assignment ():
1038
- if executor := heartbeats_composed .get (tp .topic ):
1038
+ if executor := wall_clock_executors .get (tp .topic ):
1039
1039
row = Row (
1040
1040
value = value ,
1041
1041
key = key ,
@@ -1057,7 +1057,7 @@ def _process_heartbeat(self, heartbeats_composed):
1057
1057
if not to_suppress :
1058
1058
raise
1059
1059
1060
- self ._heartbeat_last_sent = now
1060
+ self ._wall_clock_last_sent = now
1061
1061
1062
1062
def _on_assign (self , _ , topic_partitions : List [TopicPartition ]):
1063
1063
"""
0 commit comments