Package org.apache.aurora.scheduler.storage.entities

Examples of org.apache.aurora.scheduler.storage.entities.ITaskConfig


    changeState(taskId, KILLING);
  }

  @Test
  public void testThrottleTask() {
    ITaskConfig task = ITaskConfig.build(makeTask(JIM, MY_JOB).newBuilder().setIsService(true));
    String taskId = "a";
    expect(taskIdGenerator.generate(task, 0)).andReturn(taskId);
    expectStateTransitions(taskId, INIT, PENDING, ASSIGNED, RUNNING, FAILED);
    String newTaskId = "b";
    expect(taskIdGenerator.generate(task, 0)).andReturn(newTaskId);
View Full Code Here


        .andReturn(0L);
  }

  @Test
  public void testIncrementFailureCount() {
    ITaskConfig task = ITaskConfig.build(makeTask(JIM, MY_JOB).newBuilder().setIsService(true));
    String taskId = "a";
    expect(taskIdGenerator.generate(task, 0)).andReturn(taskId);
    expectStateTransitions(taskId, INIT, PENDING, ASSIGNED, RUNNING, FAILED);

    String taskId2 = "a2";
View Full Code Here

    assertEquals(1, rescheduledTask.getFailureCount());
  }

  @Test
  public void testCasTaskPresent() {
    ITaskConfig task = makeTask(JIM, MY_JOB);
    String taskId = "a";
    expect(taskIdGenerator.generate(task, 0)).andReturn(taskId);
    expectStateTransitions(taskId, INIT, PENDING, ASSIGNED, FAILED);

    control.replay();
View Full Code Here

        Optional.<String>absent()));
  }

  @Test
  public void testDeleteTasks() {
    ITaskConfig task = makeTask(JIM, MY_JOB);
    final String taskId = "a";
    expect(taskIdGenerator.generate(task, 0)).andReturn(taskId);
    expectStateTransitions(taskId, INIT, PENDING, ASSIGNED, RUNNING, FINISHED);
    eventSink.post(matchTasksDeleted(taskId));
View Full Code Here

  }

  @Test
  public void testPortResource() throws Exception {
    Set<String> requestedPorts = ImmutableSet.of("one", "two", "three");
    ITaskConfig task = ITaskConfig.build(makeTask(JIM, MY_JOB).newBuilder()
        .setRequestedPorts(requestedPorts));

    String taskId = "a";
    expect(taskIdGenerator.generate(task, 0)).andReturn(taskId);
    expectStateTransitions(taskId, INIT, PENDING, ASSIGNED);
View Full Code Here

  }

  @Test
  public void testPortResourceResetAfterReschedule() throws Exception {
    Set<String> requestedPorts = ImmutableSet.of("one");
    ITaskConfig task = ITaskConfig.build(makeTask(JIM, MY_JOB).newBuilder()
        .setRequestedPorts(requestedPorts));

    String taskId = "a";
    expect(taskIdGenerator.generate(task, 0)).andReturn(taskId);
    expectStateTransitions(taskId, INIT, PENDING, ASSIGNED, RUNNING, LOST);
View Full Code Here

    });
  }

  @Test(expected = IllegalArgumentException.class)
  public void insertPendingInstancesInstanceCollision() {
    ITaskConfig task = makeTask(JIM, MY_JOB);
    String taskId = "a";
    expect(taskIdGenerator.generate(task, 0)).andReturn(taskId).times(2);
    expectStateTransitions(taskId, INIT, PENDING);

    control.replay();
View Full Code Here

  private static Predicate<Task> queryFilter(final TaskQuery query) {
    return new Predicate<Task>() {
      @Override
      public boolean apply(Task canonicalTask) {
        IScheduledTask task = canonicalTask.storedTask;
        ITaskConfig config = task.getAssignedTask().getTask();
        if (query.getRole() != null
            && !StringUtils.isBlank(query.getRole())
            && !query.getRole().equals(config.getJob().getRole())) {
          return false;
        }
        if (query.getEnvironment() != null
            && !query.getEnvironment().equals(config.getEnvironment())) {
          return false;
        }
        if (query.getJobName() != null && !query.getJobName().equals(config.getJobName())) {
          return false;
        }

        if (query.getJobKeysSize() > 0
            && !query.getJobKeys().contains(config.getJob().newBuilder())) {
          return false;
        }
        if (query.getTaskIds() != null && !query.getTaskIds().contains(Tasks.id(task))) {
            return false;
        }
View Full Code Here

TOP

Related Classes of org.apache.aurora.scheduler.storage.entities.ITaskConfig

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.