Package org.apache.aurora.gen

Examples of org.apache.aurora.gen.JobKey


  public void testGetAllJobs() throws Exception {
    JobConfiguration cronJobOne = makeJob()
        .setCronSchedule("1 * * * *")
        .setKey(JOB_KEY.newBuilder())
        .setTaskConfig(nonProductionTask());
    JobKey jobKey2 = JOB_KEY.newBuilder().setRole("other_role");
    JobConfiguration cronJobTwo = makeJob()
        .setCronSchedule("2 * * * *")
        .setKey(jobKey2)
        .setTaskConfig(nonProductionTask());
    TaskConfig immediateTaskConfig = defaultTask(false)
View Full Code Here


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

    assertResponse(ERROR, thrift.acquireLock(LockKey.job(new JobKey()), SESSION));
  }
View Full Code Here

  public void testReleaseLockInvalidKey() throws Exception {
    control.replay();

    assertResponse(
        ERROR,
        thrift.releaseLock(new Lock().setKey(LockKey.job(new JobKey())), CHECKED, SESSION));
  }
View Full Code Here

  private AssignedTask makeAssignedTask(String job, String taskId) {
    return new AssignedTask()
        .setSlaveHost(SLAVE_HOST)
        .setTaskId(taskId)
        .setTask(new TaskConfig()
            .setJob(new JobKey("role", "staging45", job))
            .setOwner(new Identity().setRole("role").setUser("user"))
            .setEnvironment("staging45")
            .setJobName(job)
            .setExecutorConfig(new ExecutorConfig("aurora", "config")));
  }
View Full Code Here

          .setTaskConfig(TASK_CONFIG.newBuilder()));

  @Test
  public void testCreateJob() throws Exception {
    Lock lock = new Lock()
        .setKey(LockKey.job(new JobKey("role", "env", "name")))
        .setToken("token");
    SessionKey session = new SessionKey()
        .setData("session data".getBytes(StandardCharsets.UTF_8))
        .setMechanism("fake");
    Response response = new Response()
View Full Code Here

    return IScheduledTask.build(new ScheduledTask()
        .setAssignedTask(new AssignedTask()
            .setInstanceId(0)
            .setTaskId(taskId)
            .setTask(new TaskConfig()
                .setJob(new JobKey("role-" + taskId, "env-" + taskId, "job-" + taskId))
                .setJobName("job-" + taskId)
                .setOwner(new Identity().setRole("role-" + taskId).setUser("user-" + taskId))
                .setEnvironment("env-" + taskId))));
  }
View Full Code Here

        .setStatus(ScheduleStatus.PENDING)
        .setAssignedTask(new AssignedTask()
            .setInstanceId(0)
            .setTaskId(id)
            .setTask(new TaskConfig()
                .setJob(new JobKey(role, env, jobName))
                .setJobName(jobName)
                .setEnvironment(env)
                .setOwner(new Identity(role, role))
                .setExecutorConfig(new ExecutorConfig().setData("executor config")))));
  }
View Full Code Here

        Optional.<String>absent());
  }

  private static ITaskConfig makeTask(Identity owner, String job) {
    return ITaskConfig.build(new TaskConfig()
        .setJob(new JobKey(owner.getRole(), "devel", job))
        .setOwner(owner)
        .setEnvironment("devel")
        .setJobName(job)
        .setRequestedPorts(ImmutableSet.<String>of()));
  }
View Full Code Here

        .setTask(config.newBuilder()));
  }

  private static TaskConfig makeTaskConfig() {
    return new TaskConfig()
        .setJob(new JobKey(JOB.newBuilder()))
        .setJobName(JOB.getName())
        .setEnvironment(JOB.getEnvironment())
        .setOwner(new Identity(JOB.getRole(), "user"))
        .setIsService(true)
        .setExecutorConfig(new ExecutorConfig().setName("old"))
View Full Code Here

    final String pcRole = "pc-role";
    ScheduledTask ignoredProdTask = createProdTask(pcRole, 20, 20, 20).newBuilder();
    ignoredProdTask.getAssignedTask().getTask()
        .setOwner(new Identity(pcRole, "ignored"))
        .setJob(new JobKey(pcRole, ENV, pcRole));

    final String npcRole = "npc-role";
    ScheduledTask ignoredNonProdTask = createNonProdTask(npcRole, 20, 20, 20).newBuilder();
    ignoredNonProdTask.getAssignedTask().getTask()
        .setOwner(new Identity(npcRole, "ignored"))
        .setJob(new JobKey(npcRole, ENV, npcRole));

    expectCronJobs(
        createJob(createProdTask("pc", 3, 3, 3), 1),
        createJob(createNonProdTask("npc", 5, 5, 5), 2),
        createJob(IScheduledTask.build(ignoredProdTask), 2),
View Full Code Here

TOP

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

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.