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 class
EpochManager.Epoch
All inputs are segment into distinct epochs, marked by the arrival of non-record inputs.static class
EpochManager.ParallelMode
This 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 void
completeOneRecord(EpochManager.Epoch epoch)
Complete one record in the specific epoch.EpochManager.Epoch
onEpoch(EpochManager.Epoch epoch)
Add a record to a specified epoch.void
onNonRecord(Runnable triggerAction, Runnable finalAction, EpochManager.ParallelMode parallelMode)
Add a non-record to the current epoch, close current epoch and open a new epoch.EpochManager.Epoch
onRecord()
Add a record to the current epoch and return the current open epoch, the epoch will be associated with theRecordContext
of 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 theRecordContext
of 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
-
-