类 AbstractFlinkResourceReconciler<CR extends org.apache.flink.kubernetes.operator.api.AbstractFlinkResource<SPEC,​STATUS>,​SPEC extends org.apache.flink.kubernetes.operator.api.spec.AbstractFlinkSpec,​STATUS extends org.apache.flink.kubernetes.operator.api.status.CommonStatus<SPEC>>

  • 所有已实现的接口:
    Reconciler<CR>
    直接已知子类:
    AbstractJobReconciler, SessionReconciler

    public abstract class AbstractFlinkResourceReconciler<CR extends org.apache.flink.kubernetes.operator.api.AbstractFlinkResource<SPEC,​STATUS>,​SPEC extends org.apache.flink.kubernetes.operator.api.spec.AbstractFlinkSpec,​STATUS extends org.apache.flink.kubernetes.operator.api.status.CommonStatus<SPEC>>
    extends java.lang.Object
    implements Reconciler<CR>
    Base class for all Flink resource reconcilers. It contains the general flow of reconciling Flink related resources including initial deployments, upgrades, rollbacks etc.
    • 字段详细资料

      • statusRecorder

        protected final StatusRecorder<CR extends org.apache.flink.kubernetes.operator.api.AbstractFlinkResource<SPEC,​STATUS>,​STATUS extends org.apache.flink.kubernetes.operator.api.status.CommonStatus<SPEC>> statusRecorder
      • kubernetesClient

        protected final io.fabric8.kubernetes.client.KubernetesClient kubernetesClient
      • MSG_SUSPENDED

        public static final java.lang.String MSG_SUSPENDED
        另请参阅:
        常量字段值
      • MSG_SPEC_CHANGED

        public static final java.lang.String MSG_SPEC_CHANGED
        另请参阅:
        常量字段值
      • MSG_ROLLBACK

        public static final java.lang.String MSG_ROLLBACK
        另请参阅:
        常量字段值
      • MSG_SUBMIT

        public static final java.lang.String MSG_SUBMIT
        另请参阅:
        常量字段值
      • clock

        protected java.time.Clock clock
    • 方法详细资料

      • reconcile

        public void reconcile​(FlinkResourceContext<CR> ctx)
                       throws java.lang.Exception
        从接口复制的说明: Reconciler
        This is called when receiving the create or update event of the custom resource.
        指定者:
        reconcile 在接口中 Reconciler<CR extends org.apache.flink.kubernetes.operator.api.AbstractFlinkResource<SPEC,​STATUS>>
        参数:
        ctx - the context with which the operation is executed
        抛出:
        java.lang.Exception - Error during reconciliation.
      • readyToReconcile

        protected abstract boolean readyToReconcile​(FlinkResourceContext<CR> ctx)
        Check whether the given Flink resource is ready to be reconciled or we are still waiting for any pending operation or condition first.
        参数:
        ctx - Reconciliation context.
        返回:
        True if the resource is ready to be reconciled.
      • reconcileSpecChange

        protected abstract boolean reconcileSpecChange​(FlinkResourceContext<CR> ctx,
                                                       org.apache.flink.configuration.Configuration deployConfig)
                                                throws java.lang.Exception
        Reconcile spec upgrade on the currently deployed/suspended Flink resource and update the status accordingly.
        参数:
        ctx - Reconciliation context.
        deployConfig - Deployment configuration.
        返回:
        True if spec change reconciliation was executed
        抛出:
        java.lang.Exception - Error during spec upgrade.
      • reconcileOtherChanges

        protected abstract boolean reconcileOtherChanges​(FlinkResourceContext<CR> ctx)
                                                  throws java.lang.Exception
        Reconcile any other changes required for this resource that are specific to the reconciler implementation.
        参数:
        ctx - Reconciliation context.
        返回:
        True if any further reconciliation action was taken.
        抛出:
        java.lang.Exception - Error during reconciliation.
      • cleanup

        public io.javaoperatorsdk.operator.api.reconciler.DeleteControl cleanup​(FlinkResourceContext<CR> ctx)
        从接口复制的说明: Reconciler
        This is called when receiving the delete event of custom resource. This method is meant to cleanup the associated components like the Flink job components.
        指定者:
        cleanup 在接口中 Reconciler<CR extends org.apache.flink.kubernetes.operator.api.AbstractFlinkResource<SPEC,​STATUS>>
        参数:
        ctx - the context with which the operation is executed
        返回:
        DeleteControl to manage the deletion behavior
      • deploy

        @VisibleForTesting
        public abstract void deploy​(FlinkResourceContext<CR> ctx,
                                    SPEC spec,
                                    org.apache.flink.configuration.Configuration deployConfig,
                                    java.util.Optional<java.lang.String> savepoint,
                                    boolean requireHaMetadata)
                             throws java.lang.Exception
        Deploys the target resource spec to Kubernetes.
        参数:
        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
        抛出:
        java.lang.Exception - Error during deployment.
      • cleanupInternal

        protected abstract io.javaoperatorsdk.operator.api.reconciler.DeleteControl cleanupInternal​(FlinkResourceContext<CR> ctx)
        Shut down and clean up all Flink job/cluster resources.
        参数:
        ctx - Current context.
        返回:
        DeleteControl object.
      • shouldRecoverDeployment

        protected boolean shouldRecoverDeployment​(org.apache.flink.configuration.Configuration conf,
                                                  org.apache.flink.kubernetes.operator.api.FlinkDeployment deployment)
        Checks whether the JobManager Kubernetes Deployment recovery logic should be initiated. This is triggered only if, jm deployment missing, recovery config and HA enabled. This logic is only used by the Session and Application reconcilers.
        参数:
        conf - Flink cluster configuration.
        deployment - FlinkDeployment object.
        返回:
        True if recovery should be executed.
      • flinkVersionChanged

        protected boolean flinkVersionChanged​(SPEC oldSpec,
                                              SPEC newSpec)
      • setOwnerReference

        protected void setOwnerReference​(CR owner,
                                         org.apache.flink.configuration.Configuration deployConfig)
      • setClock

        @VisibleForTesting
        public void setClock​(java.time.Clock clock)