Package org.apache.aurora.gen

Examples of org.apache.aurora.gen.ScheduledTask


    }

    events.add(new TaskEvent().setTimestamp(clock.nowMillis()).setStatus(status));

    return IScheduledTask.build(
        new ScheduledTask()
            .setStatus(status)
            .setTaskEvents(ImmutableList.copyOf(events))
            .setAssignedTask(
                new AssignedTask()
                    .setTask(config.newBuilder())));
View Full Code Here


            "jobManager",
            new JobConfiguration().setKey(new JobKey("owner", "env", "jobA")))));
    snapshot.setQuotaConfigurations(
        ImmutableSet.of(new QuotaConfiguration("roleA", new ResourceAggregate(10, 1024, 1024))));
    snapshot.setSchedulerMetadata(new SchedulerMetadata().setFrameworkId("frameworkId"));
    snapshot.setTasks(ImmutableSet.of(new ScheduledTask()));
    return snapshot;
  }
View Full Code Here

    Injector injector = getInjector(memStorage);
    scheduler = injector.getInstance(TaskScheduler.class);
    eventSink = PubsubTestUtil.startPubsub(injector);

    ScheduledTask builder = TASK_A.newBuilder();
    final IScheduledTask taskA = IScheduledTask.build(builder.setStatus(PENDING));
    builder.getAssignedTask().setTaskId("b");
    final IScheduledTask taskB = IScheduledTask.build(builder.setStatus(THROTTLED));

    memStorage.write(new MutateWork.NoResult.Quiet() {
      @Override
      protected void execute(MutableStoreProvider store) {
        store.getUnsafeTaskStore().saveTasks(ImmutableSet.of(taskA, taskB));
View Full Code Here

    assertTrue(scheduler.schedule(Tasks.id(taskA)));
    assignment.getValue().apply(OFFER);
  }

  private static IScheduledTask makeTask(String taskId) {
    return IScheduledTask.build(new ScheduledTask()
        .setAssignedTask(new AssignedTask()
            .setInstanceId(0)
            .setTaskId(taskId)
            .setTask(new TaskConfig()
                .setJob(new JobKey("role-" + taskId, "env-" + taskId, "job-" + taskId))
View Full Code Here

    eventBus = injector.getInstance(EventBus.class);
    injector.getInstance(Key.get(ExceptionalCommand.class, StartupStage.class)).execute();
  }

  private static IScheduledTask makeTask(String id, ScheduleStatus status) {
    return IScheduledTask.build(new ScheduledTask()
        .setStatus(status)
        .setAssignedTask(new AssignedTask().setTaskId(id)));
  }
View Full Code Here

  @Test
  public void testPreempted() throws Exception {
    setUpHost(HOST_A, RACK_A);

    schedulingFilter = createMock(SchedulingFilter.class);
    ScheduledTask lowPriority = makeTask(USER_A, JOB_A, TASK_ID_A);
    runOnHost(lowPriority, HOST_A);

    ScheduledTask highPriority = makeTask(USER_A, JOB_A, TASK_ID_B, 100);
    clock.advance(PREEMPTION_DELAY);

    expectNoOffers();

    expectGetPendingTasks(highPriority);
View Full Code Here

  @Test
  public void testLowestPriorityPreempted() throws Exception {
    setUpHost(HOST_A, RACK_A);

    schedulingFilter = createMock(SchedulingFilter.class);
    ScheduledTask lowPriority = makeTask(USER_A, JOB_A, TASK_ID_A, 10);
    runOnHost(lowPriority, HOST_A);

    ScheduledTask lowerPriority = makeTask(USER_A, JOB_A, TASK_ID_B, 1);
    runOnHost(lowerPriority, HOST_A);

    ScheduledTask highPriority = makeTask(USER_A, JOB_A, TASK_ID_C, 100);
    clock.advance(PREEMPTION_DELAY);

    expectNoOffers();

    expectGetPendingTasks(highPriority);
View Full Code Here

  @Test
  public void testOnePreemptableTask() throws Exception {
    setUpHost(HOST_A, RACK_A);

    schedulingFilter = createMock(SchedulingFilter.class);
    ScheduledTask highPriority = makeTask(USER_A, JOB_A, TASK_ID_A, 100);
    runOnHost(highPriority, HOST_A);

    ScheduledTask lowerPriority = makeTask(USER_A, JOB_A, TASK_ID_B, 99);
    runOnHost(lowerPriority, HOST_A);

    ScheduledTask lowestPriority = makeTask(USER_A, JOB_A, TASK_ID_C, 1);
    runOnHost(lowestPriority, HOST_A);

    ScheduledTask pendingPriority = makeTask(USER_A, JOB_A, TASK_ID_D, 98);
    clock.advance(PREEMPTION_DELAY);

    expectNoOffers();

    expectGetPendingTasks(pendingPriority);
View Full Code Here

  }

  @Test
  public void testHigherPriorityRunning() throws Exception {
    schedulingFilter = createMock(SchedulingFilter.class);
    ScheduledTask highPriority = makeTask(USER_A, JOB_A, TASK_ID_B, 100);
    runOnHost(highPriority, HOST_A);

    ScheduledTask task = makeTask(USER_A, JOB_A, TASK_ID_A);
    clock.advance(PREEMPTION_DELAY);

    expectNoOffers();

    expectGetPendingTasks(task);
View Full Code Here

  public void testProductionPreemptingNonproduction() throws Exception {
    setUpHost(HOST_A, RACK_A);

    schedulingFilter = createMock(SchedulingFilter.class);
    // Use a very low priority for the production task to show that priority is irrelevant.
    ScheduledTask p1 = makeProductionTask(USER_A, JOB_A, TASK_ID_A + "_p1", -1000);
    ScheduledTask a1 = makeTask(USER_A, JOB_A, TASK_ID_B + "_a1", 100);
    runOnHost(a1, HOST_A);

    clock.advance(PREEMPTION_DELAY);

    expectNoOffers();
View Full Code Here

TOP

Related Classes of org.apache.aurora.gen.ScheduledTask

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.