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.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 SessionJobReconciler(EventRecorder eventRecorder, StatusRecorder<FlinkSessionJob,FlinkSessionJobStatus> statusRecorder, JobAutoScaler<io.javaoperatorsdk.operator.processing.event.ResourceID,KubernetesJobAutoScalerContext> autoscaler)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
cancelJob(FlinkResourceContext<FlinkSessionJob> ctx, SuspendMode suspendMode)
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
getJobUpgrade, getUpgradeModeBasedOnStateAge, reconcileOtherChanges, reconcileSpecChange, restoreJob, resubmitJob, setUpgradeSavepointPath
-
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, JobAutoScaler<io.javaoperatorsdk.operator.processing.event.ResourceID,KubernetesJobAutoScalerContext> autoscaler)
-
-
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 boolean cancelJob(FlinkResourceContext<FlinkSessionJob> 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<FlinkSessionJob,FlinkSessionJobSpec,FlinkSessionJobStatus>
- 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<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)
-
-