public class YarnFlinkResourceManager extends FlinkResourceManager<RegisteredYarnWorkerNode>
config, EXIT_CODE_FATAL_ERROR, RESOURCE_MANAGER_NAME
LOG
Constructor and Description |
---|
YarnFlinkResourceManager(Configuration flinkConfig,
org.apache.hadoop.yarn.conf.YarnConfiguration yarnConfig,
LeaderRetrievalService leaderRetrievalService,
String applicationMasterHostName,
String webInterfaceURL,
ContaineredTaskManagerParameters taskManagerParameters,
org.apache.hadoop.yarn.api.records.ContainerLaunchContext taskManagerLaunchContext,
int yarnHeartbeatIntervalMillis,
int maxFailedContainers,
int numInitialTaskManagers) |
YarnFlinkResourceManager(Configuration flinkConfig,
org.apache.hadoop.yarn.conf.YarnConfiguration yarnConfig,
LeaderRetrievalService leaderRetrievalService,
String applicationMasterHostName,
String webInterfaceURL,
ContaineredTaskManagerParameters taskManagerParameters,
org.apache.hadoop.yarn.api.records.ContainerLaunchContext taskManagerLaunchContext,
int yarnHeartbeatIntervalMillis,
int maxFailedContainers,
int numInitialTaskManagers,
YarnResourceManagerCallbackHandler callbackHandler) |
YarnFlinkResourceManager(Configuration flinkConfig,
org.apache.hadoop.yarn.conf.YarnConfiguration yarnConfig,
LeaderRetrievalService leaderRetrievalService,
String applicationMasterHostName,
String webInterfaceURL,
ContaineredTaskManagerParameters taskManagerParameters,
org.apache.hadoop.yarn.api.records.ContainerLaunchContext taskManagerLaunchContext,
int yarnHeartbeatIntervalMillis,
int maxFailedContainers,
int numInitialTaskManagers,
YarnResourceManagerCallbackHandler callbackHandler,
org.apache.hadoop.yarn.client.api.async.AMRMClientAsync<org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest> resourceManagerClient,
org.apache.hadoop.yarn.client.api.NMClient nodeManagerClient) |
Modifier and Type | Method and Description |
---|---|
static akka.actor.Props |
createActorProps(Class<? extends YarnFlinkResourceManager> actorClass,
Configuration flinkConfig,
org.apache.hadoop.yarn.conf.YarnConfiguration yarnConfig,
LeaderRetrievalService leaderRetrievalService,
String applicationMasterHostName,
String webFrontendURL,
ContaineredTaskManagerParameters taskManagerParameters,
org.apache.hadoop.yarn.api.records.ContainerLaunchContext taskManagerLaunchContext,
int numInitialTaskManagers,
org.slf4j.Logger log)
Creates the props needed to instantiate this actor.
|
protected void |
fatalError(String message,
Throwable error)
Notifies the resource master of a fatal error.
|
protected int |
getNumWorkerRequestsPending()
Gets the number of requested workers that have not yet been granted.
|
protected int |
getNumWorkersPendingRegistration()
Gets the number of containers that have been started, but where the TaskManager
has not yet registered at the job manager.
|
protected void |
handleMessage(Object message)
This method receives the actor messages after they have been filtered for
a match with the leader session.
|
protected void |
initialize()
Initializes the framework specific components.
|
protected Collection<RegisteredYarnWorkerNode> |
reacceptRegisteredWorkers(Collection<ResourceID> toConsolidate)
This method is called when the resource manager starts after a failure and reconnects to
the leader JobManager, who still has some workers registered.
|
protected void |
releasePendingWorker(ResourceID id)
Trigger a release of a pending worker.
|
protected void |
releaseStartedWorker(RegisteredYarnWorkerNode worker)
Trigger a release of a started worker.
|
protected void |
requestNewWorkers(int numWorkers)
Requests to allocate a certain number of new workers.
|
protected void |
shutdownApplication(ApplicationStatus finalStatus,
String optionalDiagnostics)
The framework specific code for shutting down the application.
|
protected RegisteredYarnWorkerNode |
workerStarted(ResourceID resourceID)
Callback when a worker was started.
|
allStartedWorkers, getDesignatedWorkerPoolSize, getLeaderSessionID, getNumberOfStartedTaskManagers, getResourceManagerProps, getStartedTaskManagers, isStarted, notifyWorkerFailed, postStop, preStart, sendInfoMessage, startResourceManagerActors, startResourceManagerActors, triggerCheckWorkers, triggerConnectingToJobManager
decorateMessage, onReceive
akka$actor$Actor$_setter_$context_$eq, akka$actor$Actor$_setter_$self_$eq, aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, getContext, getSelf, getSender, postRestart, preRestart, receive, self, sender, supervisorStrategy, unhandled
public YarnFlinkResourceManager(Configuration flinkConfig, org.apache.hadoop.yarn.conf.YarnConfiguration yarnConfig, LeaderRetrievalService leaderRetrievalService, String applicationMasterHostName, String webInterfaceURL, ContaineredTaskManagerParameters taskManagerParameters, org.apache.hadoop.yarn.api.records.ContainerLaunchContext taskManagerLaunchContext, int yarnHeartbeatIntervalMillis, int maxFailedContainers, int numInitialTaskManagers)
public YarnFlinkResourceManager(Configuration flinkConfig, org.apache.hadoop.yarn.conf.YarnConfiguration yarnConfig, LeaderRetrievalService leaderRetrievalService, String applicationMasterHostName, String webInterfaceURL, ContaineredTaskManagerParameters taskManagerParameters, org.apache.hadoop.yarn.api.records.ContainerLaunchContext taskManagerLaunchContext, int yarnHeartbeatIntervalMillis, int maxFailedContainers, int numInitialTaskManagers, YarnResourceManagerCallbackHandler callbackHandler)
public YarnFlinkResourceManager(Configuration flinkConfig, org.apache.hadoop.yarn.conf.YarnConfiguration yarnConfig, LeaderRetrievalService leaderRetrievalService, String applicationMasterHostName, String webInterfaceURL, ContaineredTaskManagerParameters taskManagerParameters, org.apache.hadoop.yarn.api.records.ContainerLaunchContext taskManagerLaunchContext, int yarnHeartbeatIntervalMillis, int maxFailedContainers, int numInitialTaskManagers, YarnResourceManagerCallbackHandler callbackHandler, org.apache.hadoop.yarn.client.api.async.AMRMClientAsync<org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest> resourceManagerClient, org.apache.hadoop.yarn.client.api.NMClient nodeManagerClient)
protected void handleMessage(Object message)
FlinkResourceManager
handleMessage
in class FlinkResourceManager<RegisteredYarnWorkerNode>
message
- The incoming actor message.protected void initialize() throws Exception
FlinkResourceManager
initialize
in class FlinkResourceManager<RegisteredYarnWorkerNode>
Exception
- Exceptions during initialization cause the resource manager to fail.
If the framework is able to recover this resource manager, it will be
restarted.protected void shutdownApplication(ApplicationStatus finalStatus, String optionalDiagnostics)
FlinkResourceManager
shutdownApplication
in class FlinkResourceManager<RegisteredYarnWorkerNode>
finalStatus
- The application status to report.optionalDiagnostics
- An optional diagnostics message.protected void fatalError(String message, Throwable error)
FlinkResourceManager
IMPORTANT: This should not cleanly shut down this master, but exit it in such a way that a high-availability setting would restart this or fail over to another master.
fatalError
in class FlinkResourceManager<RegisteredYarnWorkerNode>
protected void requestNewWorkers(int numWorkers)
FlinkResourceManager
requestNewWorkers
in class FlinkResourceManager<RegisteredYarnWorkerNode>
numWorkers
- The number of workers to allocate.protected void releasePendingWorker(ResourceID id)
FlinkResourceManager
releasePendingWorker
in class FlinkResourceManager<RegisteredYarnWorkerNode>
id
- The worker resource idprotected void releaseStartedWorker(RegisteredYarnWorkerNode worker)
FlinkResourceManager
releaseStartedWorker
in class FlinkResourceManager<RegisteredYarnWorkerNode>
worker
- The worker resource idprotected RegisteredYarnWorkerNode workerStarted(ResourceID resourceID)
FlinkResourceManager
workerStarted
in class FlinkResourceManager<RegisteredYarnWorkerNode>
resourceID
- The worker resource idprotected Collection<RegisteredYarnWorkerNode> reacceptRegisteredWorkers(Collection<ResourceID> toConsolidate)
FlinkResourceManager
FlinkResourceManager.notifyWorkerFailed(ResourceID, String)
.reacceptRegisteredWorkers
in class FlinkResourceManager<RegisteredYarnWorkerNode>
toConsolidate
- The list of TaskManagers that the JobManager knows.protected int getNumWorkerRequestsPending()
FlinkResourceManager
getNumWorkerRequestsPending
in class FlinkResourceManager<RegisteredYarnWorkerNode>
protected int getNumWorkersPendingRegistration()
FlinkResourceManager
getNumWorkersPendingRegistration
in class FlinkResourceManager<RegisteredYarnWorkerNode>
public static akka.actor.Props createActorProps(Class<? extends YarnFlinkResourceManager> actorClass, Configuration flinkConfig, org.apache.hadoop.yarn.conf.YarnConfiguration yarnConfig, LeaderRetrievalService leaderRetrievalService, String applicationMasterHostName, String webFrontendURL, ContaineredTaskManagerParameters taskManagerParameters, org.apache.hadoop.yarn.api.records.ContainerLaunchContext taskManagerLaunchContext, int numInitialTaskManagers, org.slf4j.Logger log)
Rather than extracting and validating parameters in the constructor, this factory method takes care of that. That way, errors occur synchronously, and are not swallowed simply in a failed asynchronous attempt to start the actor.
actorClass
- The actor class, to allow overriding this actor with subclasses for testing.flinkConfig
- The Flink configuration object.yarnConfig
- The YARN configuration object.applicationMasterHostName
- The hostname where this application master actor runs.webFrontendURL
- The URL of the tracking web frontend.taskManagerParameters
- The parameters for launching TaskManager containers.taskManagerLaunchContext
- The parameters for launching the TaskManager processes in the TaskManager containers.numInitialTaskManagers
- The initial number of TaskManagers to allocate.log
- The logger to log to.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.