Search in sources :

Example 1 with SchedulerProxy

use of org.apache.flink.mesos.scheduler.SchedulerProxy in project flink by apache.

the class MesosFlinkResourceManager method initialize.

// ------------------------------------------------------------------------
//  Mesos-specific behavior
// ------------------------------------------------------------------------
@Override
protected void initialize() throws Exception {
    LOG.info("Initializing Mesos resource master");
    workerStore.start();
    // create the scheduler driver to communicate with Mesos
    schedulerCallbackHandler = new SchedulerProxy(self());
    // register with Mesos
    FrameworkInfo.Builder frameworkInfo = mesosConfig.frameworkInfo().clone().setCheckpoint(true);
    Option<Protos.FrameworkID> frameworkID = workerStore.getFrameworkID();
    if (frameworkID.isEmpty()) {
        LOG.info("Registering as new framework.");
    } else {
        LOG.info("Recovery scenario: re-registering using framework ID {}.", frameworkID.get().getValue());
        frameworkInfo.setId(frameworkID.get());
    }
    MesosConfiguration initializedMesosConfig = mesosConfig.withFrameworkInfo(frameworkInfo);
    MesosConfiguration.logMesosConfig(LOG, initializedMesosConfig);
    schedulerDriver = initializedMesosConfig.createDriver(schedulerCallbackHandler, false);
    // create supporting actors
    connectionMonitor = createConnectionMonitor();
    launchCoordinator = createLaunchCoordinator();
    reconciliationCoordinator = createReconciliationCoordinator();
    taskRouter = createTaskRouter();
    recoverWorkers();
    connectionMonitor.tell(new ConnectionMonitor.Start(), self());
    schedulerDriver.start();
}
Also used : MesosConfiguration(org.apache.flink.mesos.util.MesosConfiguration) FrameworkInfo(org.apache.mesos.Protos.FrameworkInfo) ConnectionMonitor(org.apache.flink.mesos.scheduler.ConnectionMonitor) SchedulerProxy(org.apache.flink.mesos.scheduler.SchedulerProxy)

Aggregations

ConnectionMonitor (org.apache.flink.mesos.scheduler.ConnectionMonitor)1 SchedulerProxy (org.apache.flink.mesos.scheduler.SchedulerProxy)1 MesosConfiguration (org.apache.flink.mesos.util.MesosConfiguration)1 FrameworkInfo (org.apache.mesos.Protos.FrameworkInfo)1