Search in sources :

Example 11 with SchedulerDriver

use of org.apache.mesos.SchedulerDriver in project jesos by groupon.

the class LocalSchedulerMessageProcessor method frameworkRegistered.

@Subscribe
public void frameworkRegistered(final FrameworkRegisteredMessageEnvelope envelope) {
    checkState(envelope.getRecipient().equals(context.getDriverUPID()), "Received a remote message for local delivery");
    final FrameworkRegisteredMessage frameworkRegisteredMessage = envelope.getMessage();
    if (!masterIsValid(frameworkRegisteredMessage.getMasterInfo())) {
        return;
    }
    final FrameworkID frameworkId = frameworkRegisteredMessage.getFrameworkId();
    context.connected();
    context.setFailover(false);
    context.setFrameworkId(frameworkId);
    eventBus.post(new SchedulerCallback() {

        @Override
        public Runnable getCallback(final Scheduler scheduler, final SchedulerDriver schedulerDriver) {
            return new Runnable() {

                @Override
                public void run() {
                    scheduler.registered(schedulerDriver, frameworkId, context.getMaster());
                }
            };
        }
    });
}
Also used : Scheduler(org.apache.mesos.Scheduler) FrameworkRegisteredMessage(mesos.internal.Messages.FrameworkRegisteredMessage) FrameworkID(org.apache.mesos.Protos.FrameworkID) SchedulerDriver(org.apache.mesos.SchedulerDriver) Subscribe(com.google.common.eventbus.Subscribe)

Example 12 with SchedulerDriver

use of org.apache.mesos.SchedulerDriver in project elastic-job by dangdangdotcom.

the class AbstractCloudRestfulApiTest method setUpClass.

@BeforeClass
public static void setUpClass() throws Exception {
    regCenter = mock(CoordinatorRegistryCenter.class);
    jobEventRdbSearch = mock(JobEventRdbSearch.class);
    SchedulerDriver schedulerDriver = mock(SchedulerDriver.class);
    ProducerManager producerManager = new ProducerManager(schedulerDriver, regCenter);
    producerManager.startup();
    restfulService = new RestfulService(regCenter, new RestfulServerConfiguration(19000), producerManager);
    restfulService.start();
}
Also used : JobEventRdbSearch(com.dangdang.ddframe.job.event.rdb.JobEventRdbSearch) ProducerManager(com.dangdang.ddframe.job.cloud.scheduler.producer.ProducerManager) RestfulServerConfiguration(com.dangdang.ddframe.job.cloud.scheduler.env.RestfulServerConfiguration) SchedulerDriver(org.apache.mesos.SchedulerDriver) CoordinatorRegistryCenter(com.dangdang.ddframe.job.reg.base.CoordinatorRegistryCenter) BeforeClass(org.junit.BeforeClass)

Aggregations

SchedulerDriver (org.apache.mesos.SchedulerDriver)12 Subscribe (com.google.common.eventbus.Subscribe)8 Scheduler (org.apache.mesos.Scheduler)8 UPID (com.groupon.mesos.util.UPID)6 FrameworkID (org.apache.mesos.Protos.FrameworkID)3 Config (com.twitter.heron.spi.common.Config)2 Properties (java.util.Properties)2 Before (org.junit.Before)2 RestfulServerConfiguration (com.dangdang.ddframe.job.cloud.scheduler.env.RestfulServerConfiguration)1 ProducerManager (com.dangdang.ddframe.job.cloud.scheduler.producer.ProducerManager)1 JobEventRdbSearch (com.dangdang.ddframe.job.event.rdb.JobEventRdbSearch)1 CoordinatorRegistryCenter (com.dangdang.ddframe.job.reg.base.CoordinatorRegistryCenter)1 RemoteMessageEnvelope (com.groupon.mesos.scheduler.SchedulerMessageEnvelope.RemoteMessageEnvelope)1 BaseContainer (com.twitter.heron.scheduler.mesos.framework.BaseContainer)1 MesosFramework (com.twitter.heron.scheduler.mesos.framework.MesosFramework)1 ExecutorToFrameworkMessage (mesos.internal.Messages.ExecutorToFrameworkMessage)1 FrameworkErrorMessage (mesos.internal.Messages.FrameworkErrorMessage)1 FrameworkRegisteredMessage (mesos.internal.Messages.FrameworkRegisteredMessage)1 FrameworkReregisteredMessage (mesos.internal.Messages.FrameworkReregisteredMessage)1 LostSlaveMessage (mesos.internal.Messages.LostSlaveMessage)1