Class SessionReconciler
- java.lang.Object
-
- org.apache.flink.kubernetes.operator.reconciler.deployment.AbstractFlinkResourceReconciler<FlinkDeployment,FlinkDeploymentSpec,FlinkDeploymentStatus>
-
- org.apache.flink.kubernetes.operator.reconciler.deployment.SessionReconciler
-
- All Implemented Interfaces:
Reconciler<FlinkDeployment>
public class SessionReconciler extends AbstractFlinkResourceReconciler<FlinkDeployment,FlinkDeploymentSpec,FlinkDeploymentStatus>
Reconciler responsible for handling the session cluster lifecycle according to the desired and current states.
-
-
Field Summary
-
Fields inherited from class org.apache.flink.kubernetes.operator.reconciler.deployment.AbstractFlinkResourceReconciler
autoscaler, clock, eventRecorder, MSG_ROLLBACK, MSG_SPEC_CHANGED, MSG_SUBMIT, MSG_SUSPENDED, statusRecorder
-
-
Constructor Summary
Constructors Constructor Description SessionReconciler(EventRecorder eventRecorder, StatusRecorder<FlinkDeployment,FlinkDeploymentStatus> statusRecorder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.javaoperatorsdk.operator.api.reconciler.DeleteControl
cleanupInternal(FlinkResourceContext<FlinkDeployment> ctx)
Shut down and clean up all Flink job/cluster resources.void
deploy(FlinkResourceContext<FlinkDeployment> ctx, FlinkDeploymentSpec spec, org.apache.flink.configuration.Configuration deployConfig, java.util.Optional<java.lang.String> savepoint, boolean requireHaMetadata)
Deploys the target resource spec to Kubernetes.protected boolean
readyToReconcile(FlinkResourceContext<FlinkDeployment> ctx)
Check whether the given Flink resource is ready to be reconciled or we are still waiting for any pending operation or condition first.boolean
reconcileOtherChanges(FlinkResourceContext<FlinkDeployment> ctx)
Reconcile any other changes required for this resource that are specific to the reconciler implementation.protected boolean
reconcileSpecChange(DiffType diffType, FlinkResourceContext<FlinkDeployment> ctx, org.apache.flink.configuration.Configuration deployConfig, FlinkDeploymentSpec lastReconciledSpec)
Reconcile spec upgrade on the currently deployed/suspended Flink resource and update the status accordingly.-
Methods inherited from class org.apache.flink.kubernetes.operator.reconciler.deployment.AbstractFlinkResourceReconciler
cleanup, flinkVersionChanged, reconcile, setClock, setOwnerReference, shouldRecoverDeployment
-
-
-
-
Constructor Detail
-
SessionReconciler
public SessionReconciler(EventRecorder eventRecorder, StatusRecorder<FlinkDeployment,FlinkDeploymentStatus> statusRecorder)
-
-
Method Detail
-
readyToReconcile
protected boolean readyToReconcile(FlinkResourceContext<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 classAbstractFlinkResourceReconciler<FlinkDeployment,FlinkDeploymentSpec,FlinkDeploymentStatus>
- Parameters:
ctx
- Reconciliation context.- Returns:
- True if the resource is ready to be reconciled.
-
reconcileSpecChange
protected boolean reconcileSpecChange(DiffType diffType, FlinkResourceContext<FlinkDeployment> ctx, org.apache.flink.configuration.Configuration deployConfig, 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 classAbstractFlinkResourceReconciler<FlinkDeployment,FlinkDeploymentSpec,FlinkDeploymentStatus>
- Parameters:
diffType
- SpecChange diff type.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<FlinkDeployment> ctx, 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 classAbstractFlinkResourceReconciler<FlinkDeployment,FlinkDeploymentSpec,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<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 classAbstractFlinkResourceReconciler<FlinkDeployment,FlinkDeploymentSpec,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<FlinkDeployment> ctx)
Description copied from class:AbstractFlinkResourceReconciler
Shut down and clean up all Flink job/cluster resources.- Specified by:
cleanupInternal
in classAbstractFlinkResourceReconciler<FlinkDeployment,FlinkDeploymentSpec,FlinkDeploymentStatus>
- Parameters:
ctx
- Current context.- Returns:
- DeleteControl object.
-
-