Class AbstractDeploymentObserver
- java.lang.Object
-
- org.apache.flink.kubernetes.operator.observer.deployment.AbstractDeploymentObserver
-
- All Implemented Interfaces:
Observer<FlinkDeployment>
- Direct Known Subclasses:
ApplicationObserver,SessionObserver
public abstract class AbstractDeploymentObserver extends java.lang.Object implements Observer<FlinkDeployment>
The base observer.
-
-
Field Summary
Fields Modifier and Type Field Description protected FlinkConfigManagerconfigManagerprotected EventRecordereventRecorderprotected FlinkServiceflinkServiceprotected org.slf4j.Loggerlogger
-
Constructor Summary
Constructors Constructor Description AbstractDeploymentObserver(FlinkService flinkService, FlinkConfigManager configManager, EventRecorder eventRecorder)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidclearErrorsIfDeploymentIsHealthy(FlinkDeployment dep)protected booleanisJmDeploymentReady(FlinkDeployment dep)protected booleanisSuspendedJob(FlinkDeployment deployment)voidobserve(FlinkDeployment flinkApp, io.javaoperatorsdk.operator.api.reconciler.Context context)Observe the flinkApp status, It will reflect the changed status on the flinkApp resource.protected abstract voidobserveFlinkCluster(FlinkDeployment flinkApp, io.javaoperatorsdk.operator.api.reconciler.Context context, org.apache.flink.configuration.Configuration deployedConfig)Observe the flinkApp status when the cluster is ready.protected voidobserveJmDeployment(FlinkDeployment flinkApp, io.javaoperatorsdk.operator.api.reconciler.Context context, org.apache.flink.configuration.Configuration effectiveConfig)
-
-
-
Field Detail
-
logger
protected final org.slf4j.Logger logger
-
flinkService
protected final FlinkService flinkService
-
configManager
protected final FlinkConfigManager configManager
-
eventRecorder
protected final EventRecorder eventRecorder
-
-
Constructor Detail
-
AbstractDeploymentObserver
public AbstractDeploymentObserver(FlinkService flinkService, FlinkConfigManager configManager, EventRecorder eventRecorder)
-
-
Method Detail
-
observe
public void observe(FlinkDeployment flinkApp, io.javaoperatorsdk.operator.api.reconciler.Context context)
Description copied from interface:ObserverObserve the flinkApp status, It will reflect the changed status on the flinkApp resource.- Specified by:
observein interfaceObserver<FlinkDeployment>- Parameters:
flinkApp- the target custom resourcecontext- the context with which the operation is executed
-
observeJmDeployment
protected void observeJmDeployment(FlinkDeployment flinkApp, io.javaoperatorsdk.operator.api.reconciler.Context context, org.apache.flink.configuration.Configuration effectiveConfig)
-
isJmDeploymentReady
protected boolean isJmDeploymentReady(FlinkDeployment dep)
-
clearErrorsIfDeploymentIsHealthy
protected void clearErrorsIfDeploymentIsHealthy(FlinkDeployment dep)
-
isSuspendedJob
protected boolean isSuspendedJob(FlinkDeployment deployment)
-
observeFlinkCluster
protected abstract void observeFlinkCluster(FlinkDeployment flinkApp, io.javaoperatorsdk.operator.api.reconciler.Context context, org.apache.flink.configuration.Configuration deployedConfig)
Observe the flinkApp status when the cluster is ready. It will be implemented by child class to reflect the changed status on the flinkApp resource.- Parameters:
flinkApp- the target flinkDeployment resourcecontext- the context with which the operation is executeddeployedConfig- config that is deployed on the Flink cluster
-
-