public class MesosResourceManagerDriver extends AbstractResourceManagerDriver<RegisteredMesosWorkerNode>
ResourceManagerDriver
for Mesos deployment.flinkClientConfig, flinkConfig, log
Constructor and Description |
---|
MesosResourceManagerDriver(Configuration flinkConfig,
MesosServices mesosServices,
MesosConfiguration mesosConfig,
MesosTaskManagerParameters taskManagerParameters,
ContainerSpecification taskManagerContainerSpec,
String webUiUrl) |
Modifier and Type | Method and Description |
---|---|
void |
deregisterApplication(ApplicationStatus finalStatus,
String optionalDiagnostics)
The deployment specific code to deregister the application.
|
protected void |
initializeInternal()
Initialize the deployment specific components.
|
CompletableFuture<Void> |
onGrantLeadership()
This method can be overridden to add a (non-blocking) initialization routine to the
ResourceManager that will be called when leadership is granted but before leadership is
confirmed.
|
CompletableFuture<Void> |
onRevokeLeadership()
This method can be overridden to add a (non-blocking) state clearing routine to the
ResourceManager that will be called when leadership is revoked.
|
void |
releaseResource(RegisteredMesosWorkerNode workerNode)
Release resource to the external resource manager.
|
CompletableFuture<RegisteredMesosWorkerNode> |
requestResource(TaskExecutorProcessSpec taskExecutorProcessSpec)
Request resource from the external resource manager.
|
CompletableFuture<Void> |
terminate()
Terminate the deployment specific components.
|
getIoExecutor, getMainThreadExecutor, getResourceEventHandler, initialize
public MesosResourceManagerDriver(Configuration flinkConfig, MesosServices mesosServices, MesosConfiguration mesosConfig, MesosTaskManagerParameters taskManagerParameters, ContainerSpecification taskManagerContainerSpec, @Nullable String webUiUrl)
protected void initializeInternal() throws Exception
AbstractResourceManagerDriver
initializeInternal
in class AbstractResourceManagerDriver<RegisteredMesosWorkerNode>
Exception
public CompletableFuture<Void> terminate()
ResourceManagerDriver
public CompletableFuture<Void> onGrantLeadership()
ResourceManagerDriver
CompletableFuture
that completes when the computation is finished.public CompletableFuture<Void> onRevokeLeadership()
ResourceManagerDriver
CompletableFuture
that completes when the state clearing routine is
finished.public void deregisterApplication(ApplicationStatus finalStatus, @Nullable String optionalDiagnostics) throws Exception
ResourceManagerDriver
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 null
.Exception
- if the application could not be deregistered.public CompletableFuture<RegisteredMesosWorkerNode> requestResource(TaskExecutorProcessSpec taskExecutorProcessSpec)
ResourceManagerDriver
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, ResourceEventHandler.onWorkerTerminated(org.apache.flink.runtime.clusterframework.types.ResourceID, java.lang.String)
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(RegisteredMesosWorkerNode workerNode)
ResourceManagerDriver
workerNode
- Worker node to be released, in the deployment specific type.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.