1. @Public
    2. public interface CheckpointedFunction {
    3. /**
    4. * This method is called when a snapshot for a checkpoint is requested. This acts as a hook to
    5. * the function to ensure that all state is exposed by means previously offered through {@link
    6. * FunctionInitializationContext} when the Function was initialized, or offered now by {@link
    7. * FunctionSnapshotContext} itself.
    8. *
    9. * @param context the context for drawing a snapshot of the operator
    10. * @throws Exception Thrown, if state could not be created ot restored.
    11. */
    12. void snapshotState(FunctionSnapshotContext context) throws Exception;
    13. /**
    14. * This method is called when the parallel function instance is created during distributed
    15. * execution. Functions typically set up their state storing data structures in this method.
    16. *
    17. * @param context the context for initializing the operator
    18. * @throws Exception Thrown, if state could not be created ot restored.
    19. */
    20. void initializeState(FunctionInitializationContext context) throws Exception;
    21. }