public class YarnResourceManager extends ResourceManager<ResourceID> 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,
FatalErrorHandler fatalErrorHandler) |
Modifier and Type | Method and Description |
---|---|
float |
getProgress() |
protected void |
initialize()
Initializes the framework specific components.
|
void |
onContainersAllocated(List<org.apache.hadoop.yarn.api.records.Container> containers) |
void |
onContainersCompleted(List<org.apache.hadoop.yarn.api.records.ContainerStatus> list) |
void |
onError(Throwable error) |
void |
onNodesUpdated(List<org.apache.hadoop.yarn.api.records.NodeReport> list) |
void |
onShutdownRequest() |
void |
postStop()
User overridable callback.
|
protected void |
shutDownApplication(ApplicationStatus finalStatus,
String optionalDiagnostics)
The framework specific code for shutting down the application.
|
void |
startNewWorker(ResourceProfile resourceProfile)
Allocates a resource using the resource profile.
|
boolean |
stopWorker(ResourceID resourceID)
Stops the given worker.
|
protected ResourceID |
workerStarted(ResourceID resourceID)
Callback when a worker was started.
|
closeJobManagerConnection, closeTaskManagerConnection, disconnectJobManager, disconnectTaskManager, getNumberOfRegisteredTaskManagers, grantLeadership, handleError, heartbeatFromJobManager, heartbeatFromTaskManager, jobLeaderLostLeadership, notifySlotAvailable, onFatalError, registerInfoMessageListener, registerJobManager, registerTaskExecutor, releaseResource, removeJob, requestResourceOverview, requestSlot, requestTaskManagerMetricQueryServicePaths, revokeLeadership, sendInfoMessage, shutDownCluster, start, unRegisterInfoMessageListener
callAsyncWithoutFencing, getFencingToken, getMainThreadExecutor, 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, FatalErrorHandler fatalErrorHandler)
protected void initialize() throws ResourceManagerException
ResourceManager
initialize
in class ResourceManager<ResourceID>
ResourceManagerException
- which occurs during initialization and causes the resource manager to fail.public void postStop() throws Exception
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<ResourceID>
Exception
- if an error occurs. The exception is returned as result of the termination future.protected void shutDownApplication(ApplicationStatus finalStatus, String optionalDiagnostics)
ResourceManager
This method also needs to make sure all pending containers that are not registered yet are returned.
shutDownApplication
in class ResourceManager<ResourceID>
finalStatus
- The application status to report.optionalDiagnostics
- An optional diagnostics message.public void startNewWorker(ResourceProfile resourceProfile)
ResourceManager
startNewWorker
in class ResourceManager<ResourceID>
resourceProfile
- The resource descriptionpublic boolean stopWorker(ResourceID resourceID)
ResourceManager
stopWorker
in class ResourceManager<ResourceID>
resourceID
- identifying the worker to be stoppedprotected ResourceID workerStarted(ResourceID resourceID)
ResourceManager
workerStarted
in class ResourceManager<ResourceID>
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> list)
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–2018 The Apache Software Foundation. All rights reserved.