public interface FlinkKubeClient extends AutoCloseable
createTaskManagerPod(TaskManagerPodParameter)
, stopPod(String)
should be implemented asynchronously.Modifier and Type | Interface and Description |
---|---|
static interface |
FlinkKubeClient.PodCallbackHandler
Callback handler for kubernetes pods.
|
Modifier and Type | Method and Description |
---|---|
void |
createConfigMap()
Create kubernetes config map, include flink-conf.yaml, log4j.properties.
|
void |
createFlinkMasterDeployment(ClusterSpecification clusterSpec)
Create flink master deployment with replication of 1.
|
CompletableFuture<KubernetesService> |
createInternalService(String clusterId)
Create kubernetes service for internal use.
|
CompletableFuture<KubernetesService> |
createRestService(String clusterId)
Create kubernetes service for rest port.
|
CompletableFuture<Void> |
createTaskManagerPod(TaskManagerPodParameter parameter)
Create task manager pod.
|
Optional<KubernetesService> |
getInternalService(String clusterId)
Get the kubernetes internal service of the given flink clusterId.
|
List<KubernetesPod> |
getPodsWithLabels(Map<String,String> labels)
List the pods with specified labels.
|
Optional<Endpoint> |
getRestEndpoint(String clusterId)
Get the rest endpoint for access outside cluster.
|
Optional<KubernetesService> |
getRestService(String clusterId)
Get the kubernetes rest service of the given flink clusterId.
|
void |
handleException(Exception e)
Log exceptions.
|
void |
stopAndCleanupCluster(String clusterId)
Stop cluster and clean up all resources, include services, auxiliary services and all running pods.
|
CompletableFuture<Void> |
stopPod(String podName)
Stop a specified pod by name.
|
KubernetesWatch |
watchPodsAndDoCallback(Map<String,String> labels,
FlinkKubeClient.PodCallbackHandler podCallbackHandler)
Watch the pods selected by labels and do the
FlinkKubeClient.PodCallbackHandler . |
close
void createConfigMap() throws Exception
Exception
CompletableFuture<KubernetesService> createInternalService(String clusterId) throws Exception
clusterId
- cluster idException
CompletableFuture<KubernetesService> createRestService(String clusterId) throws Exception
clusterId
- cluster idException
void createFlinkMasterDeployment(ClusterSpecification clusterSpec)
clusterSpec
- ClusterSpecification
to create the flink master deployment.CompletableFuture<Void> createTaskManagerPod(TaskManagerPodParameter parameter)
parameter
- TaskManagerPodParameter
to create a taskmanager pod.CompletableFuture<Void> stopPod(String podName)
podName
- pod namevoid stopAndCleanupCluster(String clusterId)
clusterId
- cluster idOptional<KubernetesService> getInternalService(String clusterId)
clusterId
- cluster idOptional<KubernetesService> getRestService(String clusterId)
clusterId
- cluster idOptional<Endpoint> getRestEndpoint(String clusterId)
clusterId
- cluster idList<KubernetesPod> getPodsWithLabels(Map<String,String> labels)
labels
- labels to filter the podsvoid handleException(Exception e)
KubernetesWatch watchPodsAndDoCallback(Map<String,String> labels, FlinkKubeClient.PodCallbackHandler podCallbackHandler)
FlinkKubeClient.PodCallbackHandler
.labels
- labels to filter the pods to watchpodCallbackHandler
- podCallbackHandler which reacts to pod eventsCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.