public class Fabric8FlinkKubeClient extends Object implements FlinkKubeClient
FlinkKubeClient
.FlinkKubeClient.PodCallbackHandler
Constructor and Description |
---|
Fabric8FlinkKubeClient(Configuration flinkConfig,
io.fabric8.kubernetes.client.KubernetesClient client,
java.util.function.Supplier<ExecutorService> asyncExecutorFactory) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
createJobManagerComponent(KubernetesJobManagerSpecification kubernetesJMSpec)
Create the Master components, this can include the Deployment, the ConfigMap(s), and the
Service(s).
|
CompletableFuture<Void> |
createTaskManagerPod(KubernetesPod kubernetesPod)
Create task manager pod.
|
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 . |
public Fabric8FlinkKubeClient(Configuration flinkConfig, io.fabric8.kubernetes.client.KubernetesClient client, java.util.function.Supplier<ExecutorService> asyncExecutorFactory)
public void createJobManagerComponent(KubernetesJobManagerSpecification kubernetesJMSpec)
FlinkKubeClient
createJobManagerComponent
in interface FlinkKubeClient
kubernetesJMSpec
- jobmanager specificationpublic CompletableFuture<Void> createTaskManagerPod(KubernetesPod kubernetesPod)
FlinkKubeClient
createTaskManagerPod
in interface FlinkKubeClient
kubernetesPod
- taskmanager podpublic CompletableFuture<Void> stopPod(String podName)
FlinkKubeClient
stopPod
in interface FlinkKubeClient
podName
- pod namepublic Optional<Endpoint> getRestEndpoint(String clusterId)
FlinkKubeClient
getRestEndpoint
in interface FlinkKubeClient
clusterId
- cluster idpublic List<KubernetesPod> getPodsWithLabels(Map<String,String> labels)
FlinkKubeClient
getPodsWithLabels
in interface FlinkKubeClient
labels
- labels to filter the podspublic void stopAndCleanupCluster(String clusterId)
FlinkKubeClient
stopAndCleanupCluster
in interface FlinkKubeClient
clusterId
- cluster idpublic void handleException(Exception e)
FlinkKubeClient
handleException
in interface FlinkKubeClient
public Optional<KubernetesService> getRestService(String clusterId)
FlinkKubeClient
getRestService
in interface FlinkKubeClient
clusterId
- cluster idpublic KubernetesWatch watchPodsAndDoCallback(Map<String,String> labels, FlinkKubeClient.PodCallbackHandler podCallbackHandler)
FlinkKubeClient
FlinkKubeClient.PodCallbackHandler
.watchPodsAndDoCallback
in interface FlinkKubeClient
labels
- labels to filter the pods to watchpodCallbackHandler
- podCallbackHandler which reacts to pod eventspublic void close()
close
in interface AutoCloseable
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.