Class SessionJobReconciler
- java.lang.Object
-
- org.apache.flink.kubernetes.operator.reconciler.deployment.AbstractFlinkResourceReconciler<CR,SPEC,STATUS>
-
- org.apache.flink.kubernetes.operator.reconciler.deployment.AbstractJobReconciler<FlinkSessionJob,FlinkSessionJobSpec,FlinkSessionJobStatus>
-
- org.apache.flink.kubernetes.operator.reconciler.sessionjob.SessionJobReconciler
-
- All Implemented Interfaces:
Reconciler<FlinkSessionJob>
public class SessionJobReconciler extends AbstractJobReconciler<FlinkSessionJob,FlinkSessionJobSpec,FlinkSessionJobStatus>
The reconciler for theFlinkSessionJob
.
-
-
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
clock, eventRecorder, MSG_ROLLBACK, MSG_SPEC_CHANGED, MSG_SUBMIT, MSG_SUSPENDED, resourceScaler, statusRecorder
-
-
Constructor Summary
Constructors Constructor Description SessionJobReconciler(EventRecorder eventRecorder, StatusRecorder<FlinkSessionJob,FlinkSessionJobStatus> statusRecorder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cancelJob(FlinkResourceContext<FlinkSessionJob> ctx, UpgradeMode upgradeMode)
Cancel the job for the given resource using the specified upgrade mode.protected void
cleanupAfterFailedJob(FlinkResourceContext<FlinkSessionJob> ctx)
Removes a failed job.io.javaoperatorsdk.operator.api.reconciler.DeleteControl
cleanupInternal(FlinkResourceContext<FlinkSessionJob> ctx)
Shut down and clean up all Flink job/cluster resources.void
deploy(FlinkResourceContext<FlinkSessionJob> ctx, FlinkSessionJobSpec sessionJobSpec, org.apache.flink.configuration.Configuration deployConfig, java.util.Optional<java.lang.String> savepoint, boolean requireHaMetadata)
Deploys the target resource spec to Kubernetes.boolean
readyToReconcile(FlinkResourceContext<FlinkSessionJob> ctx)
Check whether the given Flink resource is ready to be reconciled or we are still waiting for any pending operation or condition first.static boolean
sessionClusterReady(java.util.Optional<FlinkDeployment> flinkDeploymentOpt)
-
Methods inherited from class org.apache.flink.kubernetes.operator.reconciler.deployment.AbstractJobReconciler
changeLastStateIfCheckpointTooOld, getAvailableUpgradeMode, reconcileOtherChanges, reconcileSpecChange, restoreJob, resubmitJob
-
Methods inherited from class org.apache.flink.kubernetes.operator.reconciler.deployment.AbstractFlinkResourceReconciler
cleanup, flinkVersionChanged, reconcile, setClock, setOwnerReference, shouldRecoverDeployment
-
-
-
-
Constructor Detail
-
SessionJobReconciler
public SessionJobReconciler(EventRecorder eventRecorder, StatusRecorder<FlinkSessionJob,FlinkSessionJobStatus> statusRecorder)
-
-
Method Detail
-
readyToReconcile
public boolean readyToReconcile(FlinkResourceContext<FlinkSessionJob> 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.- Overrides:
readyToReconcile
in classAbstractJobReconciler<FlinkSessionJob,FlinkSessionJobSpec,FlinkSessionJobStatus>
- Parameters:
ctx
- Reconciliation context.- Returns:
- True if the resource is ready to be reconciled.
-
deploy
public void deploy(FlinkResourceContext<FlinkSessionJob> ctx, FlinkSessionJobSpec sessionJobSpec, 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<FlinkSessionJob,FlinkSessionJobSpec,FlinkSessionJobStatus>
- Parameters:
ctx
- Reconciliation context.sessionJobSpec
- 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<FlinkSessionJob> 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<FlinkSessionJob,FlinkSessionJobSpec,FlinkSessionJobStatus>
- Parameters:
ctx
- Reconciler context.upgradeMode
- Upgrade mode used during cancel.- Throws:
java.lang.Exception
- Error during cancellation.
-
cleanupAfterFailedJob
protected void cleanupAfterFailedJob(FlinkResourceContext<FlinkSessionJob> ctx)
Description copied from class:AbstractJobReconciler
Removes a failed job.- Specified by:
cleanupAfterFailedJob
in classAbstractJobReconciler<FlinkSessionJob,FlinkSessionJobSpec,FlinkSessionJobStatus>
- Parameters:
ctx
- Reconciler context.
-
cleanupInternal
public io.javaoperatorsdk.operator.api.reconciler.DeleteControl cleanupInternal(FlinkResourceContext<FlinkSessionJob> ctx)
Description copied from class:AbstractFlinkResourceReconciler
Shut down and clean up all Flink job/cluster resources.- Specified by:
cleanupInternal
in classAbstractFlinkResourceReconciler<FlinkSessionJob,FlinkSessionJobSpec,FlinkSessionJobStatus>
- Parameters:
ctx
- Current context.- Returns:
- DeleteControl object.
-
sessionClusterReady
public static boolean sessionClusterReady(java.util.Optional<FlinkDeployment> flinkDeploymentOpt)
-
-