use of org.apache.mesos.Protos.TaskID in project incubator-myriad by apache.
the class SchedulerStateTest method testMakeTestLost.
@Test
public void testMakeTestLost() throws Exception {
SchedulerState sState = initialize();
TaskID idOne = TaskID.newBuilder().setValue("Task1").build();
TaskID idTwo = TaskID.newBuilder().setValue("Task2").build();
sState.makeTaskLost(idOne);
sState.makeTaskLost(idTwo);
assertEquals(2, sState.getLostTaskIds().size());
assertTrue(sState.getLostTaskIds().contains(idOne));
assertTrue(sState.getLostTaskIds().contains(idTwo));
}
use of org.apache.mesos.Protos.TaskID in project incubator-myriad by apache.
the class SchedulerStateTest method testAddTask.
@Test
public void testAddTask() throws Exception {
SchedulerState sState = initialize();
TaskID idOne = TaskID.newBuilder().setValue("Task1").build();
TaskID idTwo = TaskID.newBuilder().setValue("Task2").build();
sState.addTask(idOne, taskOne);
sState.addTask(idTwo, taskTwo);
assertEquals("zero", sState.getTask(idOne).getProfile().getName());
assertEquals("low", sState.getTask(idTwo).getProfile().getName());
}
use of org.apache.mesos.Protos.TaskID in project incubator-myriad by apache.
the class SchedulerStateTest method testMakeTestStaging.
@Test
public void testMakeTestStaging() throws Exception {
SchedulerState sState = initialize();
TaskID idOne = TaskID.newBuilder().setValue("Task1").build();
TaskID idTwo = TaskID.newBuilder().setValue("Task2").build();
sState.addTask(idOne, taskOne);
sState.addTask(idTwo, taskTwo);
sState.makeTaskStaging(idOne);
sState.makeTaskStaging(idTwo);
assertEquals(2, sState.getStagingTasks().size());
assertTrue(sState.getStagingTasks().contains(taskOne));
assertTrue(sState.getStagingTasks().contains(taskTwo));
}
use of org.apache.mesos.Protos.TaskID in project dcos-commons by mesosphere.
the class TaskKiller method killAllTasks.
@VisibleForTesting
static void killAllTasks() {
Set<TaskID> copy;
RLOCK.lock();
try {
copy = new HashSet<>(TASKS_TO_KILL);
} finally {
RLOCK.unlock();
}
for (TaskID taskId : copy) {
killTaskInternal(taskId);
}
}
Aggregations