Class NativeFlinkService
- java.lang.Object
-
- org.apache.flink.kubernetes.operator.service.AbstractFlinkService
-
- org.apache.flink.kubernetes.operator.service.NativeFlinkService
-
- All Implemented Interfaces:
FlinkService
public class NativeFlinkService extends AbstractFlinkService
Implementation ofFlinkService
submitting and interacting with Native Kubernetes Flink clusters and jobs.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.kubernetes.operator.service.FlinkService
FlinkService.ScalingResult
-
-
Field Summary
-
Fields inherited from class org.apache.flink.kubernetes.operator.service.AbstractFlinkService
artifactManager, executorService, FIELD_NAME_TOTAL_CPU, FIELD_NAME_TOTAL_MEMORY, kubernetesClient, operatorConfig
-
-
Constructor Summary
Constructors Constructor Description NativeFlinkService(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient, ArtifactManager artifactManager, java.util.concurrent.ExecutorService executorService, FlinkOperatorConfiguration operatorConfig, EventRecorder eventRecorder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelJob(FlinkDeployment deployment, UpgradeMode upgradeMode, org.apache.flink.configuration.Configuration configuration)
protected void
deleteClusterInternal(io.fabric8.kubernetes.api.model.ObjectMeta meta, org.apache.flink.configuration.Configuration conf, boolean deleteHaData, io.fabric8.kubernetes.api.model.DeletionPropagation deletionPropagation)
Delete Flink kubernetes cluster by deleting the kubernetes resources directly.protected void
deployApplicationCluster(JobSpec jobSpec, org.apache.flink.configuration.Configuration conf)
protected io.fabric8.kubernetes.api.model.PodList
getJmPodList(java.lang.String namespace, java.lang.String clusterId)
protected io.fabric8.kubernetes.api.model.PodList
getTmPodList(java.lang.String namespace, java.lang.String clusterId)
protected java.util.Map<org.apache.flink.runtime.jobgraph.JobVertexID,JobVertexResourceRequirements>
getVertexResources(org.apache.flink.client.program.rest.RestClusterClient<java.lang.String> client, AbstractFlinkResource<?,?> resource)
FlinkService.ScalingResult
scale(FlinkResourceContext<?> ctx, org.apache.flink.configuration.Configuration deployConfig)
boolean
scalingCompleted(FlinkResourceContext<?> ctx)
protected void
submitClusterInternal(org.apache.flink.configuration.Configuration conf)
void
submitSessionCluster(org.apache.flink.configuration.Configuration conf)
protected void
updateVertexResources(org.apache.flink.client.program.rest.RestClusterClient<java.lang.String> client, AbstractFlinkResource<?,?> resource, java.util.Map<org.apache.flink.runtime.jobgraph.JobVertexID,JobVertexResourceRequirements> newReqs)
-
Methods inherited from class org.apache.flink.kubernetes.operator.service.AbstractFlinkService
cancelJob, cancelSessionJob, deleteClusterDeployment, deleteHAData, disposeSavepoint, fetchCheckpointInfo, fetchSavepointInfo, getCheckpointInfo, getClusterClient, getClusterInfo, getEffectiveStatus, getJmPodList, getJobDetailsInfo, getKubernetesClient, getLastCheckpoint, getMetrics, getRestClient, isHaMetadataAvailable, isJobManagerPortReady, listJobs, removeOperatorConfigs, requestJobResult, runJar, submitApplicationCluster, submitJobToSessionCluster, triggerCheckpoint, triggerSavepoint, updateStatusAfterClusterDeletion, uploadJar, waitForClusterShutdown
-
-
-
-
Constructor Detail
-
NativeFlinkService
public NativeFlinkService(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient, ArtifactManager artifactManager, java.util.concurrent.ExecutorService executorService, FlinkOperatorConfiguration operatorConfig, EventRecorder eventRecorder)
-
-
Method Detail
-
deployApplicationCluster
protected void deployApplicationCluster(JobSpec jobSpec, org.apache.flink.configuration.Configuration conf) throws java.lang.Exception
- Specified by:
deployApplicationCluster
in classAbstractFlinkService
- Throws:
java.lang.Exception
-
submitSessionCluster
public void submitSessionCluster(org.apache.flink.configuration.Configuration conf) throws java.lang.Exception
- Throws:
java.lang.Exception
-
cancelJob
public void cancelJob(FlinkDeployment deployment, UpgradeMode upgradeMode, org.apache.flink.configuration.Configuration configuration) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getJmPodList
protected io.fabric8.kubernetes.api.model.PodList getJmPodList(java.lang.String namespace, java.lang.String clusterId)
- Specified by:
getJmPodList
in classAbstractFlinkService
-
getTmPodList
protected io.fabric8.kubernetes.api.model.PodList getTmPodList(java.lang.String namespace, java.lang.String clusterId)
- Specified by:
getTmPodList
in classAbstractFlinkService
-
submitClusterInternal
protected void submitClusterInternal(org.apache.flink.configuration.Configuration conf) throws java.lang.Exception
- Throws:
java.lang.Exception
-
deleteClusterInternal
protected void deleteClusterInternal(io.fabric8.kubernetes.api.model.ObjectMeta meta, org.apache.flink.configuration.Configuration conf, boolean deleteHaData, io.fabric8.kubernetes.api.model.DeletionPropagation deletionPropagation)
Description copied from class:AbstractFlinkService
Delete Flink kubernetes cluster by deleting the kubernetes resources directly. Optionally allows deleting the native kubernetes HA resources as well.- Specified by:
deleteClusterInternal
in classAbstractFlinkService
- Parameters:
meta
- ObjectMeta of the deploymentconf
- Configuration of the Flink applicationdeleteHaData
- Flag to indicate whether k8s or Zookeeper HA metadata should be removed as welldeletionPropagation
- Resource deletion propagation policy
-
scale
public FlinkService.ScalingResult scale(FlinkResourceContext<?> ctx, org.apache.flink.configuration.Configuration deployConfig) throws java.lang.Exception
- Throws:
java.lang.Exception
-
updateVertexResources
@VisibleForTesting protected void updateVertexResources(org.apache.flink.client.program.rest.RestClusterClient<java.lang.String> client, AbstractFlinkResource<?,?> resource, java.util.Map<org.apache.flink.runtime.jobgraph.JobVertexID,JobVertexResourceRequirements> newReqs) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getVertexResources
@VisibleForTesting protected java.util.Map<org.apache.flink.runtime.jobgraph.JobVertexID,JobVertexResourceRequirements> getVertexResources(org.apache.flink.client.program.rest.RestClusterClient<java.lang.String> client, AbstractFlinkResource<?,?> resource) throws java.lang.Exception
- Throws:
java.lang.Exception
-
scalingCompleted
public boolean scalingCompleted(FlinkResourceContext<?> ctx)
-
-