Class EpochManager
java.lang.Object
org.apache.flink.runtime.asyncprocessing.EpochManager
Epoch manager segments inputs into distinct epochs, marked by the arrival of non-records(e.g.
watermark, record attributes). Records are assigned to a unique epoch based on their arrival,
records within an epoch are allowed to be parallelized, while the non-record of an epoch can only
be executed when all records in this epoch have finished.
For more details please refer to FLIP-425.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAll inputs are segment into distinct epochs, marked by the arrival of non-record inputs.static enumThis enum defines whether parallel execution between epochs is allowed. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidComplete one record in the specific epoch.onEpoch(EpochManager.Epoch epoch) Add a record to a specified epoch.voidonNonRecord(Runnable triggerAction, Runnable finalAction, EpochManager.ParallelMode parallelMode) Add a non-record to the current epoch, close current epoch and open a new epoch.onRecord()Add a record to the current epoch and return the current open epoch, the epoch will be associated with theRecordContextof this record.
-
Constructor Details
-
EpochManager
-
-
Method Details
-
onRecord
Add a record to the current epoch and return the current open epoch, the epoch will be associated with theRecordContextof this record. Must be invoked within task thread.- Returns:
- the current open epoch.
-
onEpoch
Add a record to a specified epoch.- Parameters:
epoch- the specified epoch.- Returns:
- the specified epoch itself.
-
onNonRecord
public void onNonRecord(@Nullable Runnable triggerAction, @Nullable Runnable finalAction, EpochManager.ParallelMode parallelMode) Add a non-record to the current epoch, close current epoch and open a new epoch. Must be invoked within task thread.- Parameters:
triggerAction- the action associated with this non-record.parallelMode- the parallel mode for this epoch.
-
completeOneRecord
Complete one record in the specific epoch. Must be invoked within task thread.- Parameters:
epoch- the specific epoch
-