Package org.apache.aurora.gen

Examples of org.apache.aurora.gen.ScheduledTask


    Set<JobConfiguration> crons = ImmutableSet.of(cronJobOne, cronJobTwo, cronJobThree);

    TaskConfig immediateTaskConfig = defaultTask(false)
        .setJobName("immediate")
        .setOwner(ROLE_IDENTITY);
    IScheduledTask task1 = IScheduledTask.build(new ScheduledTask()
        .setAssignedTask(new AssignedTask().setTask(immediateTaskConfig)));
    IScheduledTask task2 = IScheduledTask.build(new ScheduledTask()
        .setAssignedTask(new AssignedTask().setTask(immediateTaskConfig.setNumCpus(2))));

    TaskConfig immediateTaskConfigTwo = defaultTask(false)
        .setJobName("immediateTwo")
        .setOwner(BAZ_ROLE_IDENTITY);
    IScheduledTask task3 = IScheduledTask.build(new ScheduledTask()
        .setAssignedTask(new AssignedTask().setTask(immediateTaskConfigTwo)));

    TaskConfig immediateTaskConfigThree = defaultTask(false)
        .setJobName("immediateThree")
        .setOwner(BAZ_ROLE_IDENTITY);
    IScheduledTask task4 = IScheduledTask.build(new ScheduledTask()
        .setAssignedTask(new AssignedTask().setTask(immediateTaskConfigThree)));

    storageUtil.expectTaskFetch(Query.unscoped(), task1, task2, task3, task4);

    expect(cronJobManager.getJobs()).andReturn(IJobConfiguration.setFromBuilders(crons));
View Full Code Here


  }

  private static Iterable<IScheduledTask> makeDefaultScheduledTasks(int n, TaskConfig config) {
    List<IScheduledTask> tasks = Lists.newArrayList();
    for (int i = 0; i < n; i++) {
      tasks.add(IScheduledTask.build(new ScheduledTask()
          .setAssignedTask(new AssignedTask().setTask(config).setInstanceId(i))));
    }

    return tasks;
  }
View Full Code Here

    slowReadFinished.countDown();
    assertEquals("slowResult", future.get());
  }

  private IScheduledTask makeTask(String taskId) {
    return IScheduledTask.build(new ScheduledTask().setAssignedTask(
        new AssignedTask()
            .setTaskId(taskId)
            .setTask(new TaskConfig()
                .setOwner(new Identity().setRole("owner-" + taskId))
                .setJobName("job-" + taskId)
View Full Code Here

    storage.write(new Storage.MutateWork.NoResult.Quiet() {
      @Override
      protected void execute(Storage.MutableStoreProvider storeProvider) {
        storeProvider.getUnsafeTaskStore().saveTasks(ImmutableSet.of(
            IScheduledTask.build(new ScheduledTask()
                .setStatus(PENDING)
                .setTaskEvents(ImmutableList.of(new TaskEvent(100, PENDING)))
                .setAssignedTask(new AssignedTask()
                    .setTaskId(TASK_ID)
                    .setInstanceId(0)
View Full Code Here

    final Set<IScheduledTask> badTasks = ImmutableSet.copyOf(Iterables.transform(
        job.getTaskConfigs().values(),
        new Function<ITaskConfig, IScheduledTask>() {
          @Override
          public IScheduledTask apply(ITaskConfig task) {
            return IScheduledTask.build(new ScheduledTask()
                .setStatus(RUNNING)
                .setAssignedTask(new AssignedTask()
                    .setInstanceId(0)
                    .setTaskId("task-" + taskId.incrementAndGet())
                    .setTask(task.newBuilder())));
View Full Code Here

        ImmutableMap.of(Tasks.SCHEDULED_TO_INFO.apply(a), Tasks.SCHEDULED_TO_INFO.apply(a)),
        identityMap);
  }

  private static IScheduledTask setHost(IScheduledTask task, Optional<String> host) {
    ScheduledTask builder = task.newBuilder();
    builder.getAssignedTask().setSlaveHost(host.orNull());
    return IScheduledTask.build(builder);
  }
View Full Code Here

    builder.getAssignedTask().setSlaveHost(host.orNull());
    return IScheduledTask.build(builder);
  }

  private static IScheduledTask setConfigData(IScheduledTask task, String configData) {
    ScheduledTask builder = task.newBuilder();
    builder.getAssignedTask().getTask().getExecutorConfig().setData(configData);
    return IScheduledTask.build(builder);
  }
View Full Code Here

        ImmutableSet.<IScheduledTask>builder().add(tasks).build(),
        store.fetchTasks(query));
  }

  private static IScheduledTask makeTask(String id, String role, String env, String jobName) {
    return IScheduledTask.build(new ScheduledTask()
        .setStatus(ScheduleStatus.PENDING)
        .setAssignedTask(new AssignedTask()
            .setInstanceId(0)
            .setTaskId(id)
            .setTask(new TaskConfig()
View Full Code Here

    LOG.info("Performing shard uniqueness sanity check.");
    storeProvider.getUnsafeTaskStore().mutateTasks(Query.unscoped(), new TaskMutation() {
      @Override
      public IScheduledTask apply(final IScheduledTask task) {
        ScheduledTask builder = task.newBuilder();
        ConfigurationManager.applyDefaultsIfUnset(builder.getAssignedTask().getTask());
        // TODO(ksweeney): Guarantee tasks pass current validation code here and quarantine if they
        // don't.
        guaranteeShardUniqueness(builder, storeProvider.getUnsafeTaskStore(), clock);
        return IScheduledTask.build(builder);
      }
View Full Code Here

  private IScheduledTask createTask(int instanceId, ITaskConfig template) {
    AssignedTask assigned = new AssignedTask()
        .setTaskId(taskIdGenerator.generate(template, instanceId))
        .setInstanceId(instanceId)
        .setTask(template.newBuilder());
    return IScheduledTask.build(new ScheduledTask()
        .setStatus(INIT)
        .setAssignedTask(assigned));
  }
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.