ProcessingTimeExecutor¶
ProcessingTimeExecutor is a TriggerExecutor that executes a trigger handler every ProcessingTimeTrigger (until the handler returns false).
ProcessingTimeExecutor is created for the following Triggers:
- Trigger.ProcessingTime in Micro-Batch Stream Processing
- Trigger.Continuous in Continuous Stream Processing
Continuous Stream Processing
ProcessingTimeExecutor is the only TriggerExecutor supported in Continuous Stream Processing.
Creating Instance¶
ProcessingTimeExecutor takes the following to be created:
- ProcessingTimeTrigger
-
Clock
ProcessingTimeExecutor is created when:
MicroBatchExecutionis created (with a ProcessingTimeTrigger)ContinuousExecutionis created (with a ContinuousTrigger)
Executing Trigger¶
execute(
triggerHandler: () => Boolean): Unit
execute is part of the TriggerExecutor abstraction.
execute calculates the next batch's start time.
execute executes the given triggerHandler every processingTimeTrigger until the given triggerHandler returns false (to signal execution termination).
Next Batch's Start Time¶
nextBatchTime(
now: Long): Long
nextBatchTime returns the start time (in millis) of the next batch interval given the current now time.