Class SessionReconciler
- java.lang.Object
-
- org.apache.flink.kubernetes.operator.reconciler.deployment.AbstractFlinkResourceReconciler<org.apache.flink.kubernetes.operator.api.FlinkDeployment,org.apache.flink.kubernetes.operator.api.spec.FlinkDeploymentSpec,org.apache.flink.kubernetes.operator.api.status.FlinkDeploymentStatus>
-
- org.apache.flink.kubernetes.operator.reconciler.deployment.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.
-
-
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<org.apache.flink.kubernetes.operator.api.FlinkDeployment,org.apache.flink.kubernetes.operator.api.status.FlinkDeploymentStatus> statusRecorder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.javaoperatorsdk.operator.api.reconciler.DeleteControlcleanupInternal(FlinkResourceContext<org.apache.flink.kubernetes.operator.api.FlinkDeployment> ctx)Shut down and clean up all Flink job/cluster resources.voiddeploy(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)Deploys the target resource spec to Kubernetes.protected booleanreadyToReconcile(FlinkResourceContext<org.apache.flink.kubernetes.operator.api.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.booleanreconcileOtherChanges(FlinkResourceContext<org.apache.flink.kubernetes.operator.api.FlinkDeployment> ctx)Reconcile any other changes required for this resource that are specific to the reconciler implementation.protected booleanreconcileSpecChange(FlinkResourceContext<org.apache.flink.kubernetes.operator.api.FlinkDeployment> ctx, org.apache.flink.configuration.Configuration deployConfig, org.apache.flink.kubernetes.operator.api.spec.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<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:AbstractFlinkResourceReconcilerCheck whether the given Flink resource is ready to be reconciled or we are still waiting for any pending operation or condition first.- Specified by:
readyToReconcilein classAbstractFlinkResourceReconciler<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:AbstractFlinkResourceReconcilerReconcile spec upgrade on the currently deployed/suspended Flink resource and update the status accordingly.- Specified by:
reconcileSpecChangein classAbstractFlinkResourceReconciler<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:AbstractFlinkResourceReconcilerDeploys the target resource spec to Kubernetes.- Specified by:
deployin classAbstractFlinkResourceReconciler<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:AbstractFlinkResourceReconcilerReconcile any other changes required for this resource that are specific to the reconciler implementation.- Specified by:
reconcileOtherChangesin classAbstractFlinkResourceReconciler<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:AbstractFlinkResourceReconcilerShut down and clean up all Flink job/cluster resources.- Specified by:
cleanupInternalin classAbstractFlinkResourceReconciler<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.
-
-