Package org.apache.aurora.gen

Examples of org.apache.aurora.gen.ScheduledTask


  @Test
  public void testProductionPreemptingNonproductionAcrossUsers() throws Exception {
    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_B, JOB_A, TASK_ID_B + "_a1", 100);
    runOnHost(a1, HOST_A);

    clock.advance(PREEMPTION_DELAY);

    expectNoOffers();
View Full Code Here


  }

  @Test
  public void testProductionUsersDoNotPreemptEachOther() throws Exception {
    schedulingFilter = createMock(SchedulingFilter.class);
    ScheduledTask p1 = makeProductionTask(USER_A, JOB_A, TASK_ID_A + "_p1", 1000);
    ScheduledTask a1 = makeProductionTask(USER_B, JOB_A, TASK_ID_B + "_a1", 0);
    runOnHost(a1, HOST_A);

    clock.advance(PREEMPTION_DELAY);

    expectNoOffers();
View Full Code Here

  // Ensures a production task can preempt 2 tasks on the same host.
  @Test
  public void testProductionPreemptingManyNonProduction() throws Exception {
    schedulingFilter = new SchedulingFilterImpl(storageUtil.storage, maintenance);
    ScheduledTask a1 = makeTask(USER_A, JOB_A, TASK_ID_A + "_a1");
    a1.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);

    ScheduledTask b1 = makeTask(USER_B, JOB_B, TASK_ID_B + "_b1");
    b1.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);

    setUpHost(HOST_A, RACK_A);

    runOnHost(a1, HOST_A);
    runOnHost(b1, HOST_A);

    ScheduledTask p1 = makeProductionTask(USER_B, JOB_B, TASK_ID_B + "_p1");
    p1.getAssignedTask().getTask().setNumCpus(2).setRamMb(1024);

    clock.advance(PREEMPTION_DELAY);

    expectNoOffers();
View Full Code Here

    legalTransition(FAILED, Action.SAVE_STATE, Action.INCREMENT_FAILURES);
  }

  @Test
  public void testHonorsUnlimitedFailures() {
    ScheduledTask task = makeTask(false);
    task.getAssignedTask().getTask().setMaxTaskFailures(-1);
    task.setFailureCount(1000);
    stateMachine = makeStateMachine(task);

    expectUpdateStateOnTransitionTo(PENDING, ASSIGNED, STARTING, RUNNING);
    legalTransition(FAILED, Action.SAVE_STATE, Action.RESCHEDULE, Action.INCREMENT_FAILURES);
  }
View Full Code Here

  // Ensures we select the minimal number of tasks to preempt
  @Test
  public void testMinimalSetPreempted() throws Exception {
    schedulingFilter = new SchedulingFilterImpl(storageUtil.storage, maintenance);
    ScheduledTask a1 = makeTask(USER_A, JOB_A, TASK_ID_A + "_a1");
    a1.getAssignedTask().getTask().setNumCpus(4).setRamMb(4096);

    ScheduledTask b1 = makeTask(USER_B, JOB_B, TASK_ID_B + "_b1");
    b1.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);

    ScheduledTask b2 = makeTask(USER_B, JOB_B, TASK_ID_B + "_b2");
    b2.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);

    setUpHost(HOST_A, RACK_A);

    runOnHost(a1, HOST_A);
    runOnHost(b1, HOST_A);
    runOnHost(b2, HOST_A);

    ScheduledTask p1 = makeProductionTask(USER_C, JOB_C, TASK_ID_C + "_p1");
    p1.getAssignedTask().getTask().setNumCpus(2).setRamMb(1024);

    clock.advance(PREEMPTION_DELAY);

    expectNoOffers();
View Full Code Here

    assertFalse(result.isSuccess());
    assertEquals(sideEffects, result.getSideEffects());
  }

  private static ScheduledTask makeTask(boolean service) {
    return new ScheduledTask()
        .setStatus(INIT.getStatus().get())
        .setAssignedTask(
            new AssignedTask()
                .setTaskId("test")
                .setTask(
View Full Code Here

  // Ensures a production task *never* preempts a production task from another job.
  @Test
  public void testProductionJobNeverPreemptsProductionJob() throws Exception {
    schedulingFilter = new SchedulingFilterImpl(storageUtil.storage, maintenance);
    ScheduledTask p1 = makeProductionTask(USER_A, JOB_A, TASK_ID_A + "_p1");
    p1.getAssignedTask().getTask().setNumCpus(2).setRamMb(1024);

    setUpHost(HOST_A, RACK_A);

    runOnHost(p1, HOST_A);

    ScheduledTask p2 = makeProductionTask(USER_B, JOB_B, TASK_ID_B + "_p2");
    p2.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);

    clock.advance(PREEMPTION_DELAY);

    expectNoOffers();

View Full Code Here

  public void testPreemptWithOfferAndTask() throws Exception {
    schedulingFilter = new SchedulingFilterImpl(storageUtil.storage, maintenance);

    setUpHost(HOST_A, RACK_A);

    ScheduledTask a1 = makeTask(USER_A, JOB_A, TASK_ID_A + "_a1");
    a1.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);
    runOnHost(a1, HOST_A);

    Offer o1 = makeOffer(OFFER_A, HOST_A, 1, Amount.of(512L, Data.MB), Amount.of(1L, Data.MB), 1);
    expectOffers(o1);

    ScheduledTask p1 = makeProductionTask(USER_B, JOB_B, TASK_ID_B + "_p1");
    p1.getAssignedTask().getTask().setNumCpus(2).setRamMb(1024);

    clock.advance(PREEMPTION_DELAY);

    expectGetActiveTasks(a1);
    expectGetPendingTasks(p1);
View Full Code Here

  public void testPreemptWithOfferAndMultipleTasks() throws Exception {
    schedulingFilter = new SchedulingFilterImpl(storageUtil.storage, maintenance);

    setUpHost(HOST_A, RACK_A);

    ScheduledTask a1 = makeTask(USER_A, JOB_A, TASK_ID_A + "_a1");
    a1.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);
    runOnHost(a1, HOST_A);

    ScheduledTask a2 = makeTask(USER_A, JOB_B, TASK_ID_A + "_a2");
    a2.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);
    runOnHost(a2, HOST_A);

    Offer o1 = makeOffer(OFFER_A, HOST_A, 2, Amount.of(1024L, Data.MB), Amount.of(1L, Data.MB), 1);
    expectOffers(o1);

    ScheduledTask p1 = makeProductionTask(USER_B, JOB_B, TASK_ID_B + "_p1");
    p1.getAssignedTask().getTask().setNumCpus(4).setRamMb(2048);

    clock.advance(PREEMPTION_DELAY);

    expectGetActiveTasks(a1, a2);
    expectGetPendingTasks(p1);
View Full Code Here

  public void testPreemptWithLargeOffer() throws Exception {
    schedulingFilter = new SchedulingFilterImpl(storageUtil.storage, maintenance);

    setUpHost(HOST_A, RACK_A);

    ScheduledTask a1 = makeTask(USER_A, JOB_A, TASK_ID_A + "_a1");
    a1.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);
    runOnHost(a1, HOST_A);

    Offer o1 = makeOffer(OFFER_A, HOST_A, 2, Amount.of(2048L, Data.MB), Amount.of(1L, Data.MB), 1);
    expectOffers(o1);

    ScheduledTask p1 = makeProductionTask(USER_B, JOB_B, TASK_ID_B + "_p1");
    p1.getAssignedTask().getTask().setNumCpus(1).setRamMb(1024);

    clock.advance(PREEMPTION_DELAY);

    expectGetActiveTasks(a1);
    expectGetPendingTasks(p1);
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.