Class AbstractJobReconciler<CR extends AbstractFlinkResource<SPEC,​STATUS>,​SPEC extends AbstractFlinkSpec,​STATUS extends CommonStatus<SPEC>>

    • Field Detail

      • LAST_STATE_DUMMY_SP_PATH

        public static final java.lang.String LAST_STATE_DUMMY_SP_PATH
        See Also:
        Constant Field Values
    • Method Detail

      • getUpgradeModeBasedOnStateAge

        @VisibleForTesting
        protected AbstractJobReconciler.JobUpgrade getUpgradeModeBasedOnStateAge​(FlinkResourceContext<CR> ctx,
                                                                                 org.apache.flink.configuration.Configuration deployConfig,
                                                                                 boolean cancellable)
                                                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • restoreJob

        protected void restoreJob​(FlinkResourceContext<CR> ctx,
                                  SPEC spec,
                                  org.apache.flink.configuration.Configuration deployConfig,
                                  boolean requireHaMetadata)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setUpgradeSavepointPath

        protected void setUpgradeSavepointPath​(FlinkResourceContext<?> ctx,
                                               java.lang.String savepointLocation)
        Updates the upgrade savepoint field in the JobSpec of the current Flink resource and if snapshot resources are enabled, a new FlinkStateSnapshot will be created.
        Parameters:
        ctx - context
        savepointLocation - location of savepoint taken
      • resubmitJob

        protected void resubmitJob​(FlinkResourceContext<CR> ctx,
                                   boolean requireHaMetadata)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • cancelJob

        protected abstract boolean cancelJob​(FlinkResourceContext<CR> ctx,
                                             SuspendMode suspendMode)
                                      throws java.lang.Exception
        Cancel the job for the given resource using the specified upgrade mode.
        Parameters:
        ctx - Reconciler context.
        suspendMode - Suspend mode used during cancel.
        Returns:
        True if this is an async cancellation
        Throws:
        java.lang.Exception - Error during cancellation.
      • cleanupAfterFailedJob

        protected abstract void cleanupAfterFailedJob​(FlinkResourceContext<CR> ctx)
                                               throws java.lang.Exception
        Removes a failed job.
        Parameters:
        ctx - Reconciler context.
        Throws:
        java.lang.Exception - Error during cancellation.