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.AvailableUpgradeMode
-
-
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 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 void
cancelJob(FlinkResourceContext<FlinkDeployment> ctx, UpgradeMode upgradeMode)
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.AvailableUpgradeMode
getAvailableUpgradeMode(FlinkResourceContext<FlinkDeployment> ctx, org.apache.flink.configuration.Configuration deployConfig)
boolean
reconcileOtherChanges(FlinkResourceContext<FlinkDeployment> ctx)
Reconcile any other changes required for this resource that are specific to the reconciler implementation.-
Methods inherited from class org.apache.flink.kubernetes.operator.reconciler.deployment.AbstractJobReconciler
changeLastStateIfCheckpointTooOld, readyToReconcile, reconcileSpecChange, restoreJob, resubmitJob
-
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
-
getAvailableUpgradeMode
protected AbstractJobReconciler.AvailableUpgradeMode getAvailableUpgradeMode(FlinkResourceContext<FlinkDeployment> ctx, org.apache.flink.configuration.Configuration deployConfig) throws java.lang.Exception
- Overrides:
getAvailableUpgradeMode
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 void cancelJob(FlinkResourceContext<FlinkDeployment> ctx, UpgradeMode upgradeMode) 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.upgradeMode
- Upgrade mode used during cancel.- 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:AbstractFlinkResourceReconciler
Reconcile any other changes required for this resource that are specific to the reconciler implementation.- Overrides:
reconcileOtherChanges
in classAbstractJobReconciler<FlinkDeployment,FlinkDeploymentSpec,FlinkDeploymentStatus>
- Parameters:
ctx
- Reconciliation context.- Returns:
- True if any further reconciliation action was taken.
- Throws:
java.lang.Exception
- Error during reconciliation.
-
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.
-
-