Examples of TaskConfig


Examples of org.apache.aurora.gen.TaskConfig

  @Test
  public void testDedicatedJob() throws Exception {
    control.replay();
    buildScheduler();

    TaskConfig newTask = nonProductionTask();
    newTask.addToConstraints(dedicatedConstraint(ImmutableSet.of(ROLE_A)));
    scheduler.createJob(makeJob(KEY_A, newTask));
    assertEquals(PENDING, getOnlyTask(Query.jobScoped(KEY_A)).getStatus());
  }
View Full Code Here

Examples of org.apache.aurora.gen.TaskConfig

  @Test
  public void testDedicatedJobKey() throws Exception {
    control.replay();
    buildScheduler();

    TaskConfig newTask = nonProductionTask();
    newTask.addToConstraints(dedicatedConstraint(ImmutableSet.of(JobKeys.canonicalString(KEY_A))));
    scheduler.createJob(makeJob(KEY_A, newTask));
    assertEquals(PENDING, getOnlyTask(Query.jobScoped(KEY_A)).getStatus());
  }
View Full Code Here

Examples of org.apache.aurora.gen.TaskConfig

  @Test
  public void testDedicatedArbitrarySuffix() throws Exception {
    control.replay();
    buildScheduler();

    TaskConfig newTask = nonProductionTask();
    newTask.addToConstraints(dedicatedConstraint(ImmutableSet.of(ROLE_A + "/arbitrary")));
    scheduler.createJob(makeJob(KEY_A, newTask, 1));
    assertEquals(PENDING, getOnlyTask(Query.jobScoped(KEY_A)).getStatus());
  }
View Full Code Here

Examples of org.apache.aurora.gen.TaskConfig

    control.replay();
    buildScheduler();

    // Schedule 5 service and 5 non-service tasks.
    scheduler.createJob(makeJob(adhocKey, numServiceTasks));
    TaskConfig task = productionTask().setIsService(true);
    scheduler.createJob(makeJob(serviceKey, task, 5));

    assertEquals(10, getTasksByStatus(PENDING).size());
    changeStatus(Query.roleScoped(ROLE_A), ASSIGNED, STARTING);
    assertEquals(10, getTasksByStatus(STARTING).size());
View Full Code Here

Examples of org.apache.aurora.gen.TaskConfig

    buildScheduler();

    int maxFailures = 5;

    // Schedule a service task.
    TaskConfig task = productionTask()
        .setIsService(true)
        .setMaxTaskFailures(maxFailures);
    scheduler.createJob(makeJob(KEY_A, task, 1));
    assertTaskCount(1);
View Full Code Here

Examples of org.apache.aurora.gen.TaskConfig

    expect(cronJobManager.hasJob(KEY_A)).andReturn(false);

    control.replay();
    buildScheduler();

    TaskConfig task = productionTask().setMaxTaskFailures(maxFailures);
    scheduler.createJob(makeJob(KEY_A, task, 1));
    assertTaskCount(1);

    assertEquals(1, getTasks(Query.jobScoped(KEY_A)).size());
View Full Code Here

Examples of org.apache.aurora.gen.TaskConfig

        job.getTaskConfig());
  }

  @Test
  public void testAddInstances() throws Exception {
    TaskConfig existingTask = productionTask();
    TaskConfig newTask = productionTask()
        .setEnvironment(ENV_A)
        .setJobName(KEY_A.getName())
        .setOwner(OWNER_A);
    ImmutableSet<Integer> instances = ImmutableSet.of(1);
View Full Code Here

Examples of org.apache.aurora.gen.TaskConfig

    assertTaskCount(2);
  }

  @Test
  public void testAddInstancesNoExistingTasks() throws Exception {
    TaskConfig newTask = productionTask()
        .setEnvironment(ENV_A)
        .setJobName(KEY_A.getName())
        .setOwner(OWNER_A);

    ImmutableSet<Integer> instances = ImmutableSet.of(1);
View Full Code Here

Examples of org.apache.aurora.gen.TaskConfig

    assertTaskCount(1);
  }

  @Test(expected = ScheduleException.class)
  public void testAddInstancesIdCollision() throws Exception {
    TaskConfig existingTask = productionTask();
    TaskConfig newTask = productionTask()
        .setEnvironment(ENV_A)
        .setJobName(KEY_A.getName())
        .setOwner(OWNER_A);

    ImmutableSet<Integer> instances = ImmutableSet.of(0);
View Full Code Here

Examples of org.apache.aurora.gen.TaskConfig

    JobConfiguration job = new JobConfiguration()
        .setOwner(makeIdentity(jobKey.newBuilder()))
        .setKey(jobKey.newBuilder())
        .setInstanceCount(numTasks)
        .setTaskConfig(new TaskConfig(task)
          .setOwner(makeIdentity(jobKey.newBuilder()))
          .setEnvironment(jobKey.getEnvironment())
          .setJobName(jobKey.getName()));
    return SanitizedConfiguration.fromUnsanitized(IJobConfiguration.build(job));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.