Class JobStatusObserver<CTX>
- java.lang.Object
-
- org.apache.flink.kubernetes.operator.observer.JobStatusObserver<CTX>
-
public abstract class JobStatusObserver<CTX> extends java.lang.ObjectAn observer to observe the job status.
-
-
Constructor Summary
Constructors Constructor Description JobStatusObserver(FlinkService flinkService, EventRecorder eventRecorder)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.util.Optional<org.apache.flink.runtime.client.JobStatusMessage>filterTargetJob(JobStatus status, java.util.List<org.apache.flink.runtime.client.JobStatusMessage> clusterJobStatuses)Filter the target job status message by the job list from the cluster.booleanobserve(AbstractFlinkResource<?,?> resource, org.apache.flink.configuration.Configuration deployedConfig, CTX ctx)Observe the status of the flink job.protected abstract voidonTimeout(CTX ctx)Callback when list jobs timeout.
-
-
-
Constructor Detail
-
JobStatusObserver
public JobStatusObserver(FlinkService flinkService, EventRecorder eventRecorder)
-
-
Method Detail
-
observe
public boolean observe(AbstractFlinkResource<?,?> resource, org.apache.flink.configuration.Configuration deployedConfig, CTX ctx)
Observe the status of the flink job.- Parameters:
resource- The custom resource to be observed.deployedConfig- Deployed job config.ctx- Observe context.- Returns:
- If job found return true, otherwise return false.
-
onTimeout
protected abstract void onTimeout(CTX ctx)
Callback when list jobs timeout.- Parameters:
ctx- Observe context.
-
filterTargetJob
protected abstract java.util.Optional<org.apache.flink.runtime.client.JobStatusMessage> filterTargetJob(JobStatus status, java.util.List<org.apache.flink.runtime.client.JobStatusMessage> clusterJobStatuses)
Filter the target job status message by the job list from the cluster.- Parameters:
status- the target job status.clusterJobStatuses- the candidate cluster jobs.- Returns:
- The target job status message. If no matched job found,
Optional.empty()will be returned.
-
-