public class YarnResourceManager extends ResourceManager<ResourceID> implements org.apache.hadoop.yarn.client.api.async.AMRMClientAsync.CallbackHandler
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
LOG |
RESOURCE_MANAGER_NAME
log
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 |
shutDown()
Shuts down the underlying RPC endpoint via the RPC service.
|
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.
|
void |
stopWorker(InstanceID instanceId) |
protected ResourceID |
workerStarted(ResourceID resourceID)
Callback when a worker was started.
|
closeJobManagerConnection, closeTaskManagerConnection, disconnectJobManager, disconnectTaskManager, getNumberOfRegisteredTaskManagers, grantLeadership, handleError, heartbeatFromJobManager, heartbeatFromTaskManager, isValid, jobLeaderLostLeadership, notifySlotAvailable, onFatalErrorAsync, registerInfoMessageListener, registerJobManager, registerTaskExecutor, removeJob, requestSlot, revokeLeadership, sendInfoMessage, shutDownCluster, start, unRegisterInfoMessageListener
callAsync, getAddress, getEndpointId, getMainThreadExecutor, getRpcService, getSelf, getSelfGatewayType, getTerminationFuture, runAsync, scheduleRunAsync, scheduleRunAsync, validateRunsInMainThread
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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 shutDown() throws Exception
RpcEndpoint
self gateway
. It will also not accepts executions in main thread
any more (via RpcEndpoint.callAsync(Callable, Time)
and RpcEndpoint.runAsync(Runnable)
).
This method can be overridden to add RPC endpoint specific shut down code. The overridden method should always call the parent shut down method.
shutDown
in class ResourceManager<ResourceID>
Exception
- indicating that the something went wrong while shutting the RPC endpoint downprotected void shutDownApplication(ApplicationStatus finalStatus, String optionalDiagnostics)
ResourceManager
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 void stopWorker(InstanceID instanceId)
stopWorker
in class ResourceManager<ResourceID>
protected 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.