Class EpochManager
- java.lang.Object
-
- org.apache.flink.runtime.asyncprocessing.EpochManager
-
public class EpochManager extends Object
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 Classes Modifier and Type Class Description static classEpochManager.EpochAll inputs are segment into distinct epochs, marked by the arrival of non-record inputs.static classEpochManager.ParallelModeThis enum defines whether parallel execution between epochs is allowed.
-
Constructor Summary
Constructors Constructor Description EpochManager(AsyncExecutionController<?,?> aec)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcompleteOneRecord(EpochManager.Epoch epoch)Complete one record in the specific epoch.EpochManager.EpochonEpoch(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.EpochManager.EpochonRecord()Add a record to the current epoch and return the current open epoch, the epoch will be associated with theRecordContextof this record.
-
-
-
Constructor Detail
-
EpochManager
public EpochManager(AsyncExecutionController<?,?> aec)
-
-
Method Detail
-
onRecord
public EpochManager.Epoch 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
public EpochManager.Epoch onEpoch(EpochManager.Epoch epoch)
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
public void completeOneRecord(EpochManager.Epoch epoch)
Complete one record in the specific epoch. Must be invoked within task thread.- Parameters:
epoch- the specific epoch
-
-