Class AbstractFlinkResourceObserver<CR extends org.apache.flink.kubernetes.operator.api.AbstractFlinkResource<?,?>>
- java.lang.Object
-
- org.apache.flink.kubernetes.operator.observer.AbstractFlinkResourceObserver<CR>
-
- All Implemented Interfaces:
Observer<CR>
- Direct Known Subclasses:
AbstractFlinkDeploymentObserver,FlinkSessionJobObserver
public abstract class AbstractFlinkResourceObserver<CR extends org.apache.flink.kubernetes.operator.api.AbstractFlinkResource<?,?>> extends java.lang.Object implements Observer<CR>
Base observer for all Flink resources.
-
-
Field Summary
Fields Modifier and Type Field Description protected EventRecordereventRecorderprotected org.slf4j.Loggerlogger
-
Constructor Summary
Constructors Constructor Description AbstractFlinkResourceObserver(EventRecorder eventRecorder)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract booleancheckIfAlreadyUpgraded(FlinkResourceContext<CR> ctx)Checks a resource that is currently in the UPGRADING state whether it was already deployed but we simply miss the status information.protected booleanisResourceReadyToBeObserved(FlinkResourceContext<CR> ctx)Check whether the resource should be observed.voidobserve(FlinkResourceContext<CR> ctx)Observe the flinkApp status, It will reflect the changed status on the flinkApp resource.protected abstract voidobserveInternal(FlinkResourceContext<CR> ctx)Internal observer logic specific to each resource type.
-
-
-
Field Detail
-
logger
protected final org.slf4j.Logger logger
-
eventRecorder
protected final EventRecorder eventRecorder
-
-
Constructor Detail
-
AbstractFlinkResourceObserver
public AbstractFlinkResourceObserver(EventRecorder eventRecorder)
-
-
Method Detail
-
observe
public final void observe(FlinkResourceContext<CR> ctx)
Description copied from interface:ObserverObserve the flinkApp status, It will reflect the changed status on the flinkApp resource.
-
isResourceReadyToBeObserved
protected boolean isResourceReadyToBeObserved(FlinkResourceContext<CR> ctx)
Check whether the resource should be observed. In certain states such as suspended applications or in-progress upgrades and rollbacks, observing is not necessary.- Parameters:
ctx- Resource context- Returns:
- True if we should observe the resource
-
observeInternal
protected abstract void observeInternal(FlinkResourceContext<CR> ctx)
Internal observer logic specific to each resource type.- Parameters:
ctx- Resource context
-
checkIfAlreadyUpgraded
protected abstract boolean checkIfAlreadyUpgraded(FlinkResourceContext<CR> ctx)
Checks a resource that is currently in the UPGRADING state whether it was already deployed but we simply miss the status information. After comparing the target resource generation with the one from the possible deployment if they match we update the status to the already DEPLOYED state.- Parameters:
ctx- Context for resource.
-
-