Search in sources :

Example 1 with MesosConfiguration

use of com.dangdang.ddframe.job.cloud.scheduler.env.MesosConfiguration in project elastic-job by dangdangdotcom.

the class SchedulerService method getSchedulerDriver.

private SchedulerDriver getSchedulerDriver(final TaskScheduler taskScheduler, final JobEventBus jobEventBus, final FrameworkIDService frameworkIDService) {
    MesosConfiguration mesosConfig = env.getMesosConfiguration();
    Optional<String> frameworkIDOptional = frameworkIDService.fetch();
    Protos.FrameworkInfo.Builder builder = Protos.FrameworkInfo.newBuilder();
    if (frameworkIDOptional.isPresent()) {
        builder.setId(Protos.FrameworkID.newBuilder().setValue(frameworkIDOptional.get()).build());
    }
    Protos.FrameworkInfo frameworkInfo = builder.setUser(mesosConfig.getUser()).setName(FRAMEWORK_NAME).setHostname(mesosConfig.getHostname()).setFailoverTimeout(FRAMEWORK_FAILOVER_TIMEOUT).setWebuiUrl(WEB_UI_PROTOCOL + env.getFrameworkHostPort()).build();
    return new MesosSchedulerDriver(new SchedulerEngine(taskScheduler, facadeService, jobEventBus, frameworkIDService, statisticManager), frameworkInfo, mesosConfig.getUrl());
}
Also used : MesosConfiguration(com.dangdang.ddframe.job.cloud.scheduler.env.MesosConfiguration) Protos(org.apache.mesos.Protos) MesosSchedulerDriver(org.apache.mesos.MesosSchedulerDriver)

Aggregations

MesosConfiguration (com.dangdang.ddframe.job.cloud.scheduler.env.MesosConfiguration)1 MesosSchedulerDriver (org.apache.mesos.MesosSchedulerDriver)1 Protos (org.apache.mesos.Protos)1