Class StandaloneFlinkService
- java.lang.Object
-
- org.apache.flink.kubernetes.operator.service.AbstractFlinkService
-
- org.apache.flink.kubernetes.operator.service.StandaloneFlinkService
-
- All Implemented Interfaces:
FlinkService
public class StandaloneFlinkService extends AbstractFlinkService
Implementation ofFlinkServicesubmitting and interacting with Standalone 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 StandaloneFlinkService(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient, ArtifactManager artifactManager, java.util.concurrent.ExecutorService executorService, FlinkOperatorConfiguration operatorConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancelJob(org.apache.flink.kubernetes.operator.api.FlinkDeployment deployment, org.apache.flink.kubernetes.operator.api.spec.UpgradeMode upgradeMode, org.apache.flink.configuration.Configuration conf)protected org.apache.flink.kubernetes.operator.kubeclient.FlinkStandaloneKubeClientcreateNamespacedKubeClient(org.apache.flink.configuration.Configuration configuration)protected voiddeleteClusterInternal(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 voiddeployApplicationCluster(org.apache.flink.kubernetes.operator.api.spec.JobSpec jobSpec, org.apache.flink.configuration.Configuration conf)protected io.fabric8.kubernetes.api.model.PodListgetJmPodList(java.lang.String namespace, java.lang.String clusterId)protected io.fabric8.kubernetes.api.model.PodListgetTmPodList(java.lang.String namespace, java.lang.String clusterId)FlinkService.ScalingResultscale(FlinkResourceContext<?> ctx, org.apache.flink.configuration.Configuration deployConfig)booleanscalingCompleted(FlinkResourceContext<?> resourceContext)protected voidsubmitClusterInternal(org.apache.flink.configuration.Configuration conf, Mode mode)voidsubmitSessionCluster(org.apache.flink.configuration.Configuration conf)-
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
-
StandaloneFlinkService
public StandaloneFlinkService(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient, ArtifactManager artifactManager, java.util.concurrent.ExecutorService executorService, FlinkOperatorConfiguration operatorConfig)
-
-
Method Detail
-
deployApplicationCluster
protected void deployApplicationCluster(org.apache.flink.kubernetes.operator.api.spec.JobSpec jobSpec, org.apache.flink.configuration.Configuration conf) throws java.lang.Exception- Specified by:
deployApplicationClusterin 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(org.apache.flink.kubernetes.operator.api.FlinkDeployment deployment, org.apache.flink.kubernetes.operator.api.spec.UpgradeMode upgradeMode, org.apache.flink.configuration.Configuration conf) 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:
getJmPodListin classAbstractFlinkService
-
getTmPodList
protected io.fabric8.kubernetes.api.model.PodList getTmPodList(java.lang.String namespace, java.lang.String clusterId)- Specified by:
getTmPodListin classAbstractFlinkService
-
createNamespacedKubeClient
@VisibleForTesting protected org.apache.flink.kubernetes.operator.kubeclient.FlinkStandaloneKubeClient createNamespacedKubeClient(org.apache.flink.configuration.Configuration configuration)
-
submitClusterInternal
protected void submitClusterInternal(org.apache.flink.configuration.Configuration conf, Mode mode) throws org.apache.flink.client.deployment.ClusterDeploymentException- Throws:
org.apache.flink.client.deployment.ClusterDeploymentException
-
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:AbstractFlinkServiceDelete Flink kubernetes cluster by deleting the kubernetes resources directly. Optionally allows deleting the native kubernetes HA resources as well.- Specified by:
deleteClusterInternalin 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)
-
scalingCompleted
public boolean scalingCompleted(FlinkResourceContext<?> resourceContext)
-
-