Class ApplicationReconciler
- java.lang.Object
-
- org.apache.flink.kubernetes.operator.reconciler.deployment.AbstractFlinkResourceReconciler<CR,SPEC,STATUS>
-
- org.apache.flink.kubernetes.operator.reconciler.deployment.AbstractJobReconciler<FlinkDeployment,FlinkDeploymentSpec,FlinkDeploymentStatus>
-
- org.apache.flink.kubernetes.operator.reconciler.deployment.ApplicationReconciler
-
- All Implemented Interfaces:
Reconciler<FlinkDeployment>
public class ApplicationReconciler extends AbstractJobReconciler<FlinkDeployment,FlinkDeploymentSpec,FlinkDeploymentStatus>
Reconciler Flink Application deployments.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.kubernetes.operator.reconciler.deployment.AbstractJobReconciler
AbstractJobReconciler.JobUpgrade
-
-
Field Summary
-
Fields inherited from class org.apache.flink.kubernetes.operator.reconciler.deployment.AbstractJobReconciler
LAST_STATE_DUMMY_SP_PATH
-
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 ApplicationReconciler(EventRecorder eventRecorder, StatusRecorder<FlinkDeployment,FlinkDeploymentStatus> statusRecorder, JobAutoScaler<io.javaoperatorsdk.operator.processing.event.ResourceID,KubernetesJobAutoScalerContext> autoscaler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
cancelJob(FlinkResourceContext<FlinkDeployment> ctx, SuspendMode suspendMode)
Cancel the job for the given resource using the specified upgrade mode.protected void
cleanupAfterFailedJob(FlinkResourceContext<FlinkDeployment> ctx)
Removes a failed job.protected 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 AbstractJobReconciler.JobUpgrade
getJobUpgrade(FlinkResourceContext<FlinkDeployment> ctx, org.apache.flink.configuration.Configuration deployConfig)
boolean
reconcileOtherChanges(FlinkResourceContext<FlinkDeployment> ctx)
Triggers any pending manual or periodic snapshots and updates the status accordingly.-
Methods inherited from class org.apache.flink.kubernetes.operator.reconciler.deployment.AbstractJobReconciler
getUpgradeModeBasedOnStateAge, readyToReconcile, reconcileSpecChange, restoreJob, resubmitJob, setUpgradeSavepointPath
-
Methods inherited from class org.apache.flink.kubernetes.operator.reconciler.deployment.AbstractFlinkResourceReconciler
cleanup, flinkVersionChanged, reconcile, setClock, setOwnerReference, shouldRecoverDeployment
-
-
-
-
Constructor Detail
-
ApplicationReconciler
public ApplicationReconciler(EventRecorder eventRecorder, StatusRecorder<FlinkDeployment,FlinkDeploymentStatus> statusRecorder, JobAutoScaler<io.javaoperatorsdk.operator.processing.event.ResourceID,KubernetesJobAutoScalerContext> autoscaler)
-
-
Method Detail
-
getJobUpgrade
protected AbstractJobReconciler.JobUpgrade getJobUpgrade(FlinkResourceContext<FlinkDeployment> ctx, org.apache.flink.configuration.Configuration deployConfig) throws java.lang.Exception
- Overrides:
getJobUpgrade
in classAbstractJobReconciler<FlinkDeployment,FlinkDeploymentSpec,FlinkDeploymentStatus>
- Throws:
java.lang.Exception
-
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.
-
cancelJob
protected boolean cancelJob(FlinkResourceContext<FlinkDeployment> ctx, SuspendMode suspendMode) throws java.lang.Exception
Description copied from class:AbstractJobReconciler
Cancel the job for the given resource using the specified upgrade mode.- Specified by:
cancelJob
in classAbstractJobReconciler<FlinkDeployment,FlinkDeploymentSpec,FlinkDeploymentStatus>
- 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 void cleanupAfterFailedJob(FlinkResourceContext<FlinkDeployment> ctx)
Description copied from class:AbstractJobReconciler
Removes a failed job.- Specified by:
cleanupAfterFailedJob
in classAbstractJobReconciler<FlinkDeployment,FlinkDeploymentSpec,FlinkDeploymentStatus>
- Parameters:
ctx
- Reconciler context.
-
reconcileOtherChanges
public boolean reconcileOtherChanges(FlinkResourceContext<FlinkDeployment> ctx) throws java.lang.Exception
Description copied from class:AbstractJobReconciler
Triggers any pending manual or periodic snapshots and updates the status accordingly.- Overrides:
reconcileOtherChanges
in classAbstractJobReconciler<FlinkDeployment,FlinkDeploymentSpec,FlinkDeploymentStatus>
- Parameters:
ctx
- Reconciliation context.- Returns:
- True if a snapshot was triggered.
- Throws:
java.lang.Exception
- An error during snapshot triggering.
-
cleanupInternal
protected 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.
-
-