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,
HighAvailabilityServices highAvailabilityServices,
HeartbeatServices heartbeatServices,
SlotManager slotManager,
MetricRegistry metricRegistry,
JobLeaderIdService jobLeaderIdService,
ClusterInformation clusterInformation,
FatalErrorHandler fatalErrorHandler,
Configuration flinkConfig,
MesosServices mesosServices,
MesosConfiguration mesosConfig,
MesosTaskManagerParameters taskManagerParameters,
ContainerSpecification taskManagerContainerSpec,
String webUiUrl,
JobManagerMetricGroup jobManagerMetricGroup) |
Modifier and Type | Method and Description |
---|---|
void |
acceptOffers(AcceptOffers msg)
Accept offers as advised by the launch coordinator.
|
protected CompletableFuture<Void> |
clearStateAsync()
This method can be overridden to add a (non-blocking) state clearing routine to the
ResourceManager that will be called when leadership is revoked.
|
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()
Initializes the framework specific components.
|
protected void |
internalDeregisterApplication(ApplicationStatus finalStatus,
String diagnostics)
The framework specific code to deregister the application.
|
protected void |
offerRescinded(OfferRescinded message)
Called when resource offers are rescinded.
|
CompletableFuture<Void> |
onStop()
User overridable callback.
|
protected CompletableFuture<Void> |
prepareLeadershipAsync()
This method can be overridden to add a (non-blocking) initialization routine to the
ResourceManager that will be called when leadership is granted but before leadership is
confirmed.
|
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 |
slaveLost(SlaveLost message) |
Collection<ResourceProfile> |
startNewWorker(ResourceProfile resourceProfile)
Allocates a resource using the resource profile.
|
protected void |
statusUpdate(StatusUpdate message)
Handles a task status update from Mesos.
|
boolean |
stopWorker(RegisteredMesosWorkerNode workerNode)
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.
|
cancelSlotRequest, closeJobManagerConnection, closeTaskManagerConnection, createSlotsPerWorker, deregisterApplication, disconnectJobManager, disconnectTaskManager, getNumberOfRegisteredTaskManagers, getNumberRequiredTaskManagerSlots, grantLeadership, handleError, heartbeatFromJobManager, heartbeatFromTaskManager, jobLeaderLostLeadership, notifySlotAvailable, onFatalError, onStart, registerInfoMessageListener, registerJobManager, registerTaskExecutor, releaseResource, removeJob, requestResourceOverview, requestSlot, requestTaskManagerFileUpload, requestTaskManagerInfo, requestTaskManagerInfo, requestTaskManagerMetricQueryServicePaths, revokeLeadership, sendInfoMessage, sendSlotReport, unRegisterInfoMessageListener
callAsyncWithoutFencing, getFencingToken, getMainThreadExecutor, getUnfencedMainThreadExecutor, runAsyncWithoutFencing, setFencingToken
callAsync, closeAsync, getAddress, getEndpointId, getHostname, getRpcService, getSelfGateway, getTerminationFuture, runAsync, scheduleRunAsync, scheduleRunAsync, start, stop, validateRunsInMainThread
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFencingToken
getAddress, getHostname
getAddress
close
public MesosResourceManager(RpcService rpcService, String resourceManagerEndpointId, ResourceID resourceId, HighAvailabilityServices highAvailabilityServices, HeartbeatServices heartbeatServices, SlotManager slotManager, MetricRegistry metricRegistry, JobLeaderIdService jobLeaderIdService, ClusterInformation clusterInformation, FatalErrorHandler fatalErrorHandler, Configuration flinkConfig, MesosServices mesosServices, MesosConfiguration mesosConfig, MesosTaskManagerParameters taskManagerParameters, ContainerSpecification taskManagerContainerSpec, @Nullable String webUiUrl, JobManagerMetricGroup jobManagerMetricGroup)
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
ResourceManager
initialize
in class ResourceManager<RegisteredMesosWorkerNode>
ResourceManagerException
- which occurs during initialization and causes the resource manager to fail.protected CompletableFuture<Void> prepareLeadershipAsync()
ResourceManager
prepareLeadershipAsync
in class ResourceManager<RegisteredMesosWorkerNode>
CompletableFuture
that completes when the computation is finished.protected CompletableFuture<Void> clearStateAsync()
ResourceManager
clearStateAsync
in class ResourceManager<RegisteredMesosWorkerNode>
CompletableFuture
that completes when the state clearing routine
is finished.public CompletableFuture<Void> onStop()
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.
onStop
in class ResourceManager<RegisteredMesosWorkerNode>
protected void internalDeregisterApplication(ApplicationStatus finalStatus, @Nullable String diagnostics) throws ResourceManagerException
ResourceManager
This method also needs to make sure all pending containers that are not registered yet are returned.
internalDeregisterApplication
in class ResourceManager<RegisteredMesosWorkerNode>
finalStatus
- The application status to report.diagnostics
- A diagnostics message or null
.ResourceManagerException
- if the application could not be shut down.public Collection<ResourceProfile> startNewWorker(ResourceProfile resourceProfile)
ResourceManager
startNewWorker
in class ResourceManager<RegisteredMesosWorkerNode>
resourceProfile
- The resource descriptionResourceProfile
describing the launched slotspublic boolean stopWorker(RegisteredMesosWorkerNode workerNode)
ResourceManager
stopWorker
in class ResourceManager<RegisteredMesosWorkerNode>
workerNode
- The worker.protected 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–2020 The Apache Software Foundation. All rights reserved.