Search in sources :

Example 6 with LaunchTasksMessage

use of mesos.internal.Messages.LaunchTasksMessage in project jesos by groupon.

the class InternalSchedulerDriver method launchTasks.

@Override
public Status launchTasks(final Collection<OfferID> offerIds, final Collection<TaskInfo> tasks, final Filters filters) {
    checkNotNull(offerIds, "offerIds is null");
    checkNotNull(tasks, "tasks is null");
    checkNotNull(filters, "filters is null");
    if (!context.isStateMachine(DRIVER_RUNNING)) {
        return context.getStateMachine();
    }
    final LaunchTasksMessage message = LaunchTasksMessage.newBuilder().setFrameworkId(context.getFrameworkId()).addAllOfferIds(offerIds).addAllTasks(tasks).setFilters(filters).build();
    doLaunchTasks(message);
    return context.getStateMachine();
}
Also used : LaunchTasksMessage(mesos.internal.Messages.LaunchTasksMessage)

Example 7 with LaunchTasksMessage

use of mesos.internal.Messages.LaunchTasksMessage in project jesos by groupon.

the class InternalSchedulerDriver method declineOffer.

@Override
public Status declineOffer(final OfferID offerId) {
    checkNotNull(offerId, "offerId is null");
    if (!context.isStateMachine(DRIVER_RUNNING)) {
        return context.getStateMachine();
    }
    final LaunchTasksMessage message = LaunchTasksMessage.newBuilder().setFrameworkId(context.getFrameworkId()).addOfferIds(offerId).setFilters(Filters.newBuilder().build()).build();
    doLaunchTasks(message);
    return context.getStateMachine();
}
Also used : LaunchTasksMessage(mesos.internal.Messages.LaunchTasksMessage)

Aggregations

LaunchTasksMessage (mesos.internal.Messages.LaunchTasksMessage)7 ImmutableList (com.google.common.collect.ImmutableList)1 RemoteMessageEnvelope (com.groupon.mesos.scheduler.SchedulerMessageEnvelope.RemoteMessageEnvelope)1 FrameworkID (org.apache.mesos.Protos.FrameworkID)1 MasterInfo (org.apache.mesos.Protos.MasterInfo)1 OfferID (org.apache.mesos.Protos.OfferID)1 TaskInfo (org.apache.mesos.Protos.TaskInfo)1