Ejemplo n.º 1
0
 def on_element(self, element, timestamp, window: W) -> bool:
     if window.max_timestamp() <= self._ctx.get_current_watermark():
         # if the watermark is already past the window fire immediately
         return True
     else:
         self._ctx.register_event_time_timer(window.max_timestamp())
         return False
 def _cleanup_time(self, window: W) -> int:
     if self._window_assigner.is_event_time():
         cleanup_time = window.max_timestamp() + self._allowed_lateness
         if cleanup_time >= window.max_timestamp():
             return cleanup_time
         else:
             return MAX_LONG_VALUE
     else:
         return window.max_timestamp()
Ejemplo n.º 3
0
 def clear(self, window: W) -> None:
     self._ctx.delete_event_time_timer(window.max_timestamp())
Ejemplo n.º 4
0
 def on_merge(self, window: W, merge_context: TriggerContext):
     self._ctx.register_event_time_timer(window.max_timestamp())
Ejemplo n.º 5
0
 def on_event_time(self, time: int, window: W) -> bool:
     return time == window.max_timestamp()
Ejemplo n.º 6
0
 def clear(self, window: W) -> None:
     self._ctx.delete_processing_time_timer(window.max_timestamp())
Ejemplo n.º 7
0
 def on_processing_time(self, time: int, window: W) -> bool:
     return time == window.max_timestamp()
Ejemplo n.º 8
0
 def on_element(self, element, timestamp, window: W) -> bool:
     self._ctx.register_processing_time_timer(window.max_timestamp())
     return False