Class SessionReconciler

  • All Implemented Interfaces:
    Reconciler<org.apache.flink.kubernetes.operator.api.FlinkDeployment>

    public class SessionReconciler
    extends AbstractFlinkResourceReconciler<org.apache.flink.kubernetes.operator.api.FlinkDeployment,​org.apache.flink.kubernetes.operator.api.spec.FlinkDeploymentSpec,​org.apache.flink.kubernetes.operator.api.status.FlinkDeploymentStatus>
    Reconciler responsible for handling the session cluster lifecycle according to the desired and current states.
    • Constructor Detail

      • SessionReconciler

        public SessionReconciler​(EventRecorder eventRecorder,
                                 StatusRecorder<org.apache.flink.kubernetes.operator.api.FlinkDeployment,​org.apache.flink.kubernetes.operator.api.status.FlinkDeploymentStatus> statusRecorder)
    • Method Detail

      • readyToReconcile

        protected boolean readyToReconcile​(FlinkResourceContext<org.apache.flink.kubernetes.operator.api.FlinkDeployment> ctx)
        Description copied from class: AbstractFlinkResourceReconciler
        Check whether the given Flink resource is ready to be reconciled or we are still waiting for any pending operation or condition first.
        Specified by:
        readyToReconcile in class AbstractFlinkResourceReconciler<org.apache.flink.kubernetes.operator.api.FlinkDeployment,​org.apache.flink.kubernetes.operator.api.spec.FlinkDeploymentSpec,​org.apache.flink.kubernetes.operator.api.status.FlinkDeploymentStatus>
        Parameters:
        ctx - Reconciliation context.
        Returns:
        True if the resource is ready to be reconciled.
      • reconcileSpecChange

        protected boolean reconcileSpecChange​(FlinkResourceContext<org.apache.flink.kubernetes.operator.api.FlinkDeployment> ctx,
                                              org.apache.flink.configuration.Configuration deployConfig,
                                              org.apache.flink.kubernetes.operator.api.spec.FlinkDeploymentSpec lastReconciledSpec)
                                       throws java.lang.Exception
        Description copied from class: AbstractFlinkResourceReconciler
        Reconcile spec upgrade on the currently deployed/suspended Flink resource and update the status accordingly.
        Specified by:
        reconcileSpecChange in class AbstractFlinkResourceReconciler<org.apache.flink.kubernetes.operator.api.FlinkDeployment,​org.apache.flink.kubernetes.operator.api.spec.FlinkDeploymentSpec,​org.apache.flink.kubernetes.operator.api.status.FlinkDeploymentStatus>
        Parameters:
        ctx - Reconciliation context.
        deployConfig - Deployment configuration.
        lastReconciledSpec - Last reconciled spec
        Returns:
        True if spec change reconciliation was executed
        Throws:
        java.lang.Exception - Error during spec upgrade.
      • deploy

        public void deploy​(FlinkResourceContext<org.apache.flink.kubernetes.operator.api.FlinkDeployment> ctx,
                           org.apache.flink.kubernetes.operator.api.spec.FlinkDeploymentSpec spec,
                           org.apache.flink.configuration.Configuration deployConfig,
                           java.util.Optional<java.lang.String> savepoint,
                           boolean requireHaMetadata)
                    throws java.lang.Exception
        Description copied from class: AbstractFlinkResourceReconciler
        Deploys the target resource spec to Kubernetes.
        Specified by:
        deploy in class AbstractFlinkResourceReconciler<org.apache.flink.kubernetes.operator.api.FlinkDeployment,​org.apache.flink.kubernetes.operator.api.spec.FlinkDeploymentSpec,​org.apache.flink.kubernetes.operator.api.status.FlinkDeploymentStatus>
        Parameters:
        ctx - Reconciliation context.
        spec - Spec that should be deployed to Kubernetes.
        deployConfig - Flink conf for the deployment.
        savepoint - Optional savepoint path for applications and session jobs.
        requireHaMetadata - Flag used by application deployments to validate HA metadata
        Throws:
        java.lang.Exception - Error during deployment.
      • reconcileOtherChanges

        public boolean reconcileOtherChanges​(FlinkResourceContext<org.apache.flink.kubernetes.operator.api.FlinkDeployment> ctx)
                                      throws java.lang.Exception
        Description copied from class: AbstractFlinkResourceReconciler
        Reconcile any other changes required for this resource that are specific to the reconciler implementation.
        Specified by:
        reconcileOtherChanges in class AbstractFlinkResourceReconciler<org.apache.flink.kubernetes.operator.api.FlinkDeployment,​org.apache.flink.kubernetes.operator.api.spec.FlinkDeploymentSpec,​org.apache.flink.kubernetes.operator.api.status.FlinkDeploymentStatus>
        Parameters:
        ctx - Reconciliation context.
        Returns:
        True if any further reconciliation action was taken.
        Throws:
        java.lang.Exception - Error during reconciliation.
      • cleanupInternal

        public io.javaoperatorsdk.operator.api.reconciler.DeleteControl cleanupInternal​(FlinkResourceContext<org.apache.flink.kubernetes.operator.api.FlinkDeployment> ctx)
        Description copied from class: AbstractFlinkResourceReconciler
        Shut down and clean up all Flink job/cluster resources.
        Specified by:
        cleanupInternal in class AbstractFlinkResourceReconciler<org.apache.flink.kubernetes.operator.api.FlinkDeployment,​org.apache.flink.kubernetes.operator.api.spec.FlinkDeploymentSpec,​org.apache.flink.kubernetes.operator.api.status.FlinkDeploymentStatus>
        Parameters:
        ctx - Current context.
        Returns:
        DeleteControl object.