public class YarnResourceManager extends ResourceManager<YarnWorkerNode> implements org.apache.hadoop.yarn.client.api.async.AMRMClientAsync.CallbackHandler
RpcEndpoint.MainThreadExecutor
RESOURCE_MANAGER_NAME
log, rpcServer
Constructor and Description |
---|
YarnResourceManager(RpcService rpcService,
String resourceManagerEndpointId,
ResourceID resourceId,
Configuration flinkConfig,
Map<String,String> env,
ResourceManagerConfiguration resourceManagerConfiguration,
HighAvailabilityServices highAvailabilityServices,
HeartbeatServices heartbeatServices,
SlotManager slotManager,
MetricRegistry metricRegistry,
JobLeaderIdService jobLeaderIdService,
ClusterInformation clusterInformation,
FatalErrorHandler fatalErrorHandler,
String webInterfaceUrl,
JobManagerMetricGroup jobManagerMetricGroup) |
Modifier and Type | Method and Description |
---|---|
protected org.apache.hadoop.yarn.client.api.NMClient |
createAndStartNodeManagerClient(org.apache.hadoop.yarn.conf.YarnConfiguration yarnConfiguration) |
protected org.apache.hadoop.yarn.client.api.async.AMRMClientAsync<org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest> |
createAndStartResourceManagerClient(org.apache.hadoop.yarn.conf.YarnConfiguration yarnConfiguration,
int yarnHeartbeatIntervalMillis,
String webInterfaceUrl) |
float |
getProgress() |
protected void |
initialize()
Initializes the framework specific components.
|
protected void |
internalDeregisterApplication(ApplicationStatus finalStatus,
String diagnostics)
The framework specific code to deregister the application.
|
void |
onContainersAllocated(List<org.apache.hadoop.yarn.api.records.Container> containers) |
void |
onContainersCompleted(List<org.apache.hadoop.yarn.api.records.ContainerStatus> statuses) |
void |
onError(Throwable error) |
void |
onNodesUpdated(List<org.apache.hadoop.yarn.api.records.NodeReport> list) |
void |
onShutdownRequest() |
CompletableFuture<Void> |
postStop()
User overridable callback.
|
void |
startNewWorker(ResourceProfile resourceProfile)
Allocates a resource using the resource profile.
|
boolean |
stopWorker(YarnWorkerNode workerNode)
Stops the given worker.
|
protected YarnWorkerNode |
workerStarted(ResourceID resourceID)
Callback when a worker was started.
|
cancelSlotRequest, clearStateAsync, closeJobManagerConnection, closeTaskManagerConnection, deregisterApplication, disconnectJobManager, disconnectTaskManager, getNumberOfRegisteredTaskManagers, getNumberPendingSlotRequests, grantLeadership, handleError, heartbeatFromJobManager, heartbeatFromTaskManager, jobLeaderLostLeadership, notifySlotAvailable, onFatalError, prepareLeadershipAsync, registerInfoMessageListener, registerJobManager, registerTaskExecutor, releaseResource, removeJob, requestResourceOverview, requestSlot, requestTaskManagerFileUpload, requestTaskManagerInfo, requestTaskManagerInfo, requestTaskManagerMetricQueryServicePaths, revokeLeadership, sendInfoMessage, sendSlotReport, start, unRegisterInfoMessageListener
callAsyncWithoutFencing, getFencingToken, getMainThreadExecutor, getUnfencedMainThreadExecutor, runAsyncWithoutFencing, setFencingToken
callAsync, getAddress, getEndpointId, getHostname, getRpcService, getSelfGateway, getTerminationFuture, runAsync, scheduleRunAsync, scheduleRunAsync, shutDown, stop, validateRunsInMainThread
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFencingToken
getAddress, getHostname
getAddress
public YarnResourceManager(RpcService rpcService, String resourceManagerEndpointId, ResourceID resourceId, Configuration flinkConfig, Map<String,String> env, ResourceManagerConfiguration resourceManagerConfiguration, HighAvailabilityServices highAvailabilityServices, HeartbeatServices heartbeatServices, SlotManager slotManager, MetricRegistry metricRegistry, JobLeaderIdService jobLeaderIdService, ClusterInformation clusterInformation, FatalErrorHandler fatalErrorHandler, @Nullable String webInterfaceUrl, JobManagerMetricGroup jobManagerMetricGroup)
protected org.apache.hadoop.yarn.client.api.async.AMRMClientAsync<org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest> createAndStartResourceManagerClient(org.apache.hadoop.yarn.conf.YarnConfiguration yarnConfiguration, int yarnHeartbeatIntervalMillis, @Nullable String webInterfaceUrl) throws Exception
Exception
protected org.apache.hadoop.yarn.client.api.NMClient createAndStartNodeManagerClient(org.apache.hadoop.yarn.conf.YarnConfiguration yarnConfiguration)
protected void initialize() throws ResourceManagerException
ResourceManager
initialize
in class ResourceManager<YarnWorkerNode>
ResourceManagerException
- which occurs during initialization and causes the resource manager to fail.public CompletableFuture<Void> postStop()
RpcEndpoint
This method is called when the RpcEndpoint is being shut down. The method is guaranteed to be executed in the main thread context and can be used to clean up internal state.
IMPORTANT: This method should never be called directly by the user.
postStop
in class ResourceManager<YarnWorkerNode>
protected void internalDeregisterApplication(ApplicationStatus finalStatus, @Nullable String diagnostics)
ResourceManager
This method also needs to make sure all pending containers that are not registered yet are returned.
internalDeregisterApplication
in class ResourceManager<YarnWorkerNode>
finalStatus
- The application status to report.diagnostics
- A diagnostics message or null
.public void startNewWorker(ResourceProfile resourceProfile)
ResourceManager
startNewWorker
in class ResourceManager<YarnWorkerNode>
resourceProfile
- The resource descriptionpublic boolean stopWorker(YarnWorkerNode workerNode)
ResourceManager
stopWorker
in class ResourceManager<YarnWorkerNode>
workerNode
- The worker.protected YarnWorkerNode workerStarted(ResourceID resourceID)
ResourceManager
workerStarted
in class ResourceManager<YarnWorkerNode>
resourceID
- The worker resource idpublic float getProgress()
getProgress
in interface org.apache.hadoop.yarn.client.api.async.AMRMClientAsync.CallbackHandler
public void onContainersCompleted(List<org.apache.hadoop.yarn.api.records.ContainerStatus> statuses)
onContainersCompleted
in interface org.apache.hadoop.yarn.client.api.async.AMRMClientAsync.CallbackHandler
public void onContainersAllocated(List<org.apache.hadoop.yarn.api.records.Container> containers)
onContainersAllocated
in interface org.apache.hadoop.yarn.client.api.async.AMRMClientAsync.CallbackHandler
public void onShutdownRequest()
onShutdownRequest
in interface org.apache.hadoop.yarn.client.api.async.AMRMClientAsync.CallbackHandler
public void onNodesUpdated(List<org.apache.hadoop.yarn.api.records.NodeReport> list)
onNodesUpdated
in interface org.apache.hadoop.yarn.client.api.async.AMRMClientAsync.CallbackHandler
public void onError(Throwable error)
onError
in interface org.apache.hadoop.yarn.client.api.async.AMRMClientAsync.CallbackHandler
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.