public class MesosFlinkResourceManager extends FlinkResourceManager<RegisteredMesosWorkerNode>
config, EXIT_CODE_FATAL_ERROR, RESOURCE_MANAGER_NAME
LOG
Constructor and Description |
---|
MesosFlinkResourceManager(Configuration flinkConfig,
MesosConfiguration mesosConfig,
MesosWorkerStore workerStore,
LeaderRetrievalService leaderRetrievalService,
MesosTaskManagerParameters taskManagerParameters,
ContainerSpecification taskManagerContainerSpec,
MesosArtifactResolver artifactResolver,
int maxFailedTasks,
int numInitialTaskManagers) |
Modifier and Type | Method and Description |
---|---|
static akka.actor.Props |
createActorProps(Class<? extends MesosFlinkResourceManager> actorClass,
Configuration flinkConfig,
MesosConfiguration mesosConfig,
MesosWorkerStore workerStore,
LeaderRetrievalService leaderRetrievalService,
MesosTaskManagerParameters taskManagerParameters,
ContainerSpecification taskManagerContainerSpec,
MesosArtifactResolver artifactResolver,
org.slf4j.Logger log)
Creates the props needed to instantiate this actor.
|
protected akka.actor.ActorRef |
createConnectionMonitor() |
protected akka.actor.ActorRef |
createLaunchCoordinator() |
protected akka.actor.ActorRef |
createReconciliationCoordinator() |
protected akka.actor.ActorRef |
createTaskRouter() |
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.
|
void |
postStop() |
protected Collection<RegisteredMesosWorkerNode> |
reacceptRegisteredWorkers(Collection<ResourceID> toConsolidate)
Accept the given registered workers into the internal state.
|
protected void |
releasePendingWorker(ResourceID id)
Release the given pending worker.
|
protected void |
releaseStartedWorker(RegisteredMesosWorkerNode worker)
Release the given started worker.
|
protected void |
requestNewWorkers(int numWorkers)
Plan for some additional workers to be launched.
|
protected void |
shutdownApplication(ApplicationStatus finalStatus,
String optionalDiagnostics)
Called to shut down the cluster (not a failover situation).
|
protected RegisteredMesosWorkerNode |
workerStarted(ResourceID resourceID)
Accept the given started worker into the internal state.
|
allStartedWorkers, getDesignatedWorkerPoolSize, getLeaderSessionID, getNumberOfStartedTaskManagers, getResourceManagerProps, getStartedTaskManagers, isStarted, notifyWorkerFailed, 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 MesosFlinkResourceManager(Configuration flinkConfig, MesosConfiguration mesosConfig, MesosWorkerStore workerStore, LeaderRetrievalService leaderRetrievalService, MesosTaskManagerParameters taskManagerParameters, ContainerSpecification taskManagerContainerSpec, MesosArtifactResolver artifactResolver, int maxFailedTasks, int numInitialTaskManagers)
protected void initialize() throws Exception
FlinkResourceManager
initialize
in class FlinkResourceManager<RegisteredMesosWorkerNode>
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 akka.actor.ActorRef createConnectionMonitor()
protected akka.actor.ActorRef createTaskRouter()
protected akka.actor.ActorRef createLaunchCoordinator()
protected akka.actor.ActorRef createReconciliationCoordinator()
public void postStop()
postStop
in interface akka.actor.Actor
postStop
in class FlinkResourceManager<RegisteredMesosWorkerNode>
protected void handleMessage(Object message)
FlinkResourceManager
handleMessage
in class FlinkResourceManager<RegisteredMesosWorkerNode>
message
- The incoming actor message.protected void shutdownApplication(ApplicationStatus finalStatus, String optionalDiagnostics)
shutdownApplication
in class FlinkResourceManager<RegisteredMesosWorkerNode>
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<RegisteredMesosWorkerNode>
protected void requestNewWorkers(int numWorkers)
requestNewWorkers
in class FlinkResourceManager<RegisteredMesosWorkerNode>
numWorkers
- The number of workers to allocate.protected RegisteredMesosWorkerNode workerStarted(ResourceID resourceID)
workerStarted
in class FlinkResourceManager<RegisteredMesosWorkerNode>
resourceID
- The worker resource idprotected Collection<RegisteredMesosWorkerNode> reacceptRegisteredWorkers(Collection<ResourceID> toConsolidate)
reacceptRegisteredWorkers
in class FlinkResourceManager<RegisteredMesosWorkerNode>
toConsolidate
- The worker IDs known previously to the JobManager.protected void releasePendingWorker(ResourceID id)
releasePendingWorker
in class FlinkResourceManager<RegisteredMesosWorkerNode>
id
- The worker resource idprotected void releaseStartedWorker(RegisteredMesosWorkerNode worker)
releaseStartedWorker
in class FlinkResourceManager<RegisteredMesosWorkerNode>
worker
- The worker resource idprotected int getNumWorkerRequestsPending()
FlinkResourceManager
getNumWorkerRequestsPending
in class FlinkResourceManager<RegisteredMesosWorkerNode>
protected int getNumWorkersPendingRegistration()
FlinkResourceManager
getNumWorkersPendingRegistration
in class FlinkResourceManager<RegisteredMesosWorkerNode>
public static akka.actor.Props createActorProps(Class<? extends MesosFlinkResourceManager> actorClass, Configuration flinkConfig, MesosConfiguration mesosConfig, MesosWorkerStore workerStore, LeaderRetrievalService leaderRetrievalService, MesosTaskManagerParameters taskManagerParameters, ContainerSpecification taskManagerContainerSpec, MesosArtifactResolver artifactResolver, 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.taskManagerParameters
- The parameters for launching TaskManager containers.taskManagerContainerSpec
- The container specification.artifactResolver
- The artifact resolver to locate artifactslog
- The logger to log to.Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.