public class MesosResourceManager extends ResourceManager<RegisteredMesosWorkerNode>
RpcEndpoint.MainThreadExecutor
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
LOG |
RESOURCE_MANAGER_NAME
log, rpcServer
Constructor and Description |
---|
MesosResourceManager(RpcService rpcService,
String resourceManagerEndpointId,
ResourceID resourceId,
ResourceManagerConfiguration resourceManagerConfiguration,
HighAvailabilityServices highAvailabilityServices,
HeartbeatServices heartbeatServices,
SlotManager slotManager,
MetricRegistry metricRegistry,
JobLeaderIdService jobLeaderIdService,
FatalErrorHandler fatalErrorHandler,
Configuration flinkConfig,
MesosServices mesosServices,
MesosConfiguration mesosConfig,
MesosTaskManagerParameters taskManagerParameters,
ContainerSpecification taskManagerContainerSpec) |
Modifier and Type | Method and Description |
---|---|
void |
acceptOffers(AcceptOffers msg)
Accept offers as advised by the launch coordinator.
|
protected akka.actor.ActorRef |
createConnectionMonitor() |
protected akka.actor.ActorRef |
createLaunchCoordinator(org.apache.mesos.SchedulerDriver schedulerDriver,
akka.actor.ActorRef selfActor) |
protected akka.actor.ActorRef |
createReconciliationCoordinator(org.apache.mesos.SchedulerDriver schedulerDriver) |
protected akka.actor.ActorRef |
createSelfActor() |
protected akka.actor.ActorRef |
createTaskMonitor(org.apache.mesos.SchedulerDriver schedulerDriver) |
protected void |
disconnected(Disconnected message)
Called when disconnected from Mesos.
|
protected void |
executorLost(ExecutorLost message) |
protected void |
frameworkMessage(FrameworkMessage message) |
protected void |
initialize()
Starts the Mesos-specifics.
|
protected void |
offerRescinded(OfferRescinded message)
Called when resource offers are rescinded.
|
void |
postStop()
User overridable callback.
|
void |
reconcile(org.apache.flink.mesos.scheduler.ReconciliationCoordinator.Reconcile message)
Handles a reconciliation request from a task monitor.
|
protected void |
registered(Registered message) |
protected void |
reregistered(ReRegistered message)
Called when reconnected to Mesos following a failover event.
|
protected void |
resourceOffers(ResourceOffers message)
Called when resource offers are made to the framework.
|
protected void |
shutDownApplication(ApplicationStatus finalStatus,
String optionalDiagnostics)
The framework specific code for shutting down the application.
|
protected void |
slaveLost(SlaveLost message) |
void |
startNewWorker(ResourceProfile resourceProfile)
Allocates a resource using the resource profile.
|
protected void |
statusUpdate(StatusUpdate message)
Handles a task status update from Mesos.
|
boolean |
stopWorker(ResourceID resourceID)
Stops the given worker.
|
void |
taskTerminated(org.apache.flink.mesos.scheduler.TaskMonitor.TaskTerminated message)
Handles a termination notification from a task monitor.
|
protected RegisteredMesosWorkerNode |
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 MesosResourceManager(RpcService rpcService, String resourceManagerEndpointId, ResourceID resourceId, ResourceManagerConfiguration resourceManagerConfiguration, HighAvailabilityServices highAvailabilityServices, HeartbeatServices heartbeatServices, SlotManager slotManager, MetricRegistry metricRegistry, JobLeaderIdService jobLeaderIdService, FatalErrorHandler fatalErrorHandler, Configuration flinkConfig, MesosServices mesosServices, MesosConfiguration mesosConfig, MesosTaskManagerParameters taskManagerParameters, ContainerSpecification taskManagerContainerSpec)
protected akka.actor.ActorRef createSelfActor()
protected akka.actor.ActorRef createConnectionMonitor()
protected akka.actor.ActorRef createTaskMonitor(org.apache.mesos.SchedulerDriver schedulerDriver)
protected akka.actor.ActorRef createLaunchCoordinator(org.apache.mesos.SchedulerDriver schedulerDriver, akka.actor.ActorRef selfActor)
protected akka.actor.ActorRef createReconciliationCoordinator(org.apache.mesos.SchedulerDriver schedulerDriver)
protected void initialize() throws ResourceManagerException
initialize
in class ResourceManager<RegisteredMesosWorkerNode>
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<RegisteredMesosWorkerNode>
Exception
- if an error occurs. The exception is returned as result of the termination future.protected void shutDownApplication(ApplicationStatus finalStatus, String optionalDiagnostics) throws ResourceManagerException
ResourceManager
This method also needs to make sure all pending containers that are not registered yet are returned.
shutDownApplication
in class ResourceManager<RegisteredMesosWorkerNode>
finalStatus
- The application status to report.optionalDiagnostics
- An optional diagnostics message.ResourceManagerException
- if the application could not be shut down.public void startNewWorker(ResourceProfile resourceProfile)
ResourceManager
startNewWorker
in class ResourceManager<RegisteredMesosWorkerNode>
resourceProfile
- The resource descriptionpublic boolean stopWorker(ResourceID resourceID)
ResourceManager
stopWorker
in class ResourceManager<RegisteredMesosWorkerNode>
resourceID
- identifying the worker to be stoppedprotected RegisteredMesosWorkerNode workerStarted(ResourceID resourceID)
workerStarted
in class ResourceManager<RegisteredMesosWorkerNode>
resourceID
- The worker resource id (as provided by the TaskExecutor)protected void registered(Registered message)
protected void reregistered(ReRegistered message)
protected void disconnected(Disconnected message)
protected void resourceOffers(ResourceOffers message)
protected void offerRescinded(OfferRescinded message)
protected void statusUpdate(StatusUpdate message)
protected void frameworkMessage(FrameworkMessage message)
protected void slaveLost(SlaveLost message)
protected void executorLost(ExecutorLost message)
public void acceptOffers(AcceptOffers msg)
Acceptance is routed through the RM to update the persistent state before forwarding the message to Mesos.
public void reconcile(org.apache.flink.mesos.scheduler.ReconciliationCoordinator.Reconcile message)
public void taskTerminated(org.apache.flink.mesos.scheduler.TaskMonitor.TaskTerminated message)
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.