public class KubernetesResourceManagerDriver extends AbstractResourceManagerDriver<KubernetesWorkerNode>
ResourceManagerDriverfor Kubernetes deployment.
flinkClientConfig, flinkConfig, log
|Constructor and Description|
|Modifier and Type||Method and Description|
The deployment specific code to deregister the application.
Initialize the deployment specific components.
Release resource to the external resource manager.
Request resource from the external resource manager.
Terminate the deployment specific components.
getIoExecutor, getMainThreadExecutor, getResourceEventHandler, initialize
public KubernetesResourceManagerDriver(Configuration flinkConfig, FlinkKubeClient flinkKubeClient, KubernetesResourceManagerDriverConfiguration configuration)
protected void initializeInternal() throws Exception
public void terminate() throws Exception
public void deregisterApplication(ApplicationStatus finalStatus, @Nullable String optionalDiagnostics)
This method also needs to make sure all pending containers that are not registered yet are returned.
finalStatus- The application status to report.
optionalDiagnostics- A diagnostics message or
public CompletableFuture<KubernetesWorkerNode> requestResource(TaskExecutorProcessSpec taskExecutorProcessSpec)
This method request a new resource from the external resource manager, and tries to launch a task manager inside the allocated resource, with respect to the provided taskExecutorProcessSpec. The returned future will be completed with a worker node in the deployment specific type, or exceptionally if the allocation has failed.
Note: Completion of the returned future does not necessarily mean the success of resource
allocation and task manager launching. Allocation and launching failures can still happen
after the future completion. In such cases,
will be called.
The future is guaranteed to be completed in the rpc main thread, before trying to launch
the task manager, thus before the task manager registration. It is also guaranteed that
ResourceEventHandler.onWorkerTerminated(org.apache.flink.runtime.clusterframework.types.ResourceID, java.lang.String) will not be called on the requested worker,
until the returned future is completed successfully.
taskExecutorProcessSpec- Resource specification of the requested worker.
public void releaseResource(KubernetesWorkerNode worker)
worker- Worker node to be released, in the deployment specific type.
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.