Package org.apache.aurora.gen

Examples of org.apache.aurora.gen.JobUpdate


              new InstanceTaskConfig()
                  .setTask(request.getTaskConfig().newBuilder())
                  .setInstances(convertRanges(Numbers.toRanges(diff.getReplacementInstances()))));
        }

        IJobUpdate update = IJobUpdate.build(new JobUpdate()
            .setSummary(new JobUpdateSummary()
                .setJobKey(job.newBuilder())
                .setUpdateId(updateId)
                .setUser(context.getIdentity()))
            .setInstructions(instructions));
View Full Code Here


        .setFrameworkId(frameworkId)
        .setVersion(CURRENT_API_VERSION);
    final String updateId1 = "updateId1";
    final String updateId2 = "updateId2";
    IJobUpdateDetails updateDetails1 = IJobUpdateDetails.build(new JobUpdateDetails()
        .setUpdate(new JobUpdate().setSummary(new JobUpdateSummary().setUpdateId(updateId1)))
        .setUpdateEvents(ImmutableList.of(new JobUpdateEvent().setStatus(JobUpdateStatus.ERROR)))
        .setInstanceEvents(ImmutableList.of(new JobInstanceUpdateEvent().setTimestampMs(123L))));

    IJobUpdateDetails updateDetails2 = IJobUpdateDetails.build(new JobUpdateDetails()
        .setUpdate(new JobUpdate().setSummary(new JobUpdateSummary().setUpdateId(updateId2))));

    storageUtil.expectOperations();
    expect(storageUtil.taskStore.fetchTasks(Query.unscoped())).andReturn(tasks);
    expect(storageUtil.quotaStore.fetchQuotas())
        .andReturn(ImmutableMap.of("steve", ResourceAggregates.none()));
View Full Code Here

    return builder.build();
  }

  private static JobUpdateDetails createJobUpdateDetails() {
    return new JobUpdateDetails()
        .setUpdate(new JobUpdate().setSummary(createJobUpdateSummaries(1).get(0)));
  }
View Full Code Here

        oldTask1.getAssignedTask().getTask(), ImmutableSet.of(new Range(0, 1))));

    expect(quotaManager.checkJobUpdate(anyObject(IJobUpdate.class))).andReturn(ENOUGH_QUOTA);

    // Set diff-adjusted IJobUpdate expectations.
    JobUpdate expected = update.newBuilder();
    expected.getInstructions().setInitialState(ImmutableSet.of(
        new InstanceTaskConfig(newTask.newBuilder(), ImmutableSet.of(new Range(1, 1)))));
    expected.getInstructions().unsetDesiredState();

    expect(uuidGenerator.createNew()).andReturn(UU_ID);
    storageUtil.expectTaskFetch(
        Query.unscoped().byJob(JOB_KEY).active(),
        oldTask1,
View Full Code Here

    IScheduledTask oldTask = buildScheduledTask(0, 5);
    storageUtil.expectTaskFetch(Query.unscoped().byJob(JOB_KEY).active(), oldTask);

    ITaskConfig newTask = buildScheduledTask(0, 8).getAssignedTask().getTask();
    JobUpdate builder = buildJobUpdate(
        1,
        newTask,
        ImmutableMap.of(oldTask.getAssignedTask().getTask(), ImmutableSet.of(new Range(0, 0))))
        .newBuilder();
    builder.getInstructions().getSettings()
        .setUpdateOnlyTheseInstances(ImmutableSet.of(new Range(100, 100)));

    control.replay();
    JobUpdateRequest request = buildJobUpdateRequest(IJobUpdate.build(builder));
    assertResponse(OK, thrift.startJobUpdate(request, SESSION));
View Full Code Here

    ImmutableSet.Builder<InstanceTaskConfig> builder = ImmutableSet.builder();
    for (Map.Entry<ITaskConfig, ImmutableSet<Range>> entry : oldConfigMap.entrySet()) {
      builder.add(new InstanceTaskConfig(entry.getKey().newBuilder(), entry.getValue()));
    }

    return IJobUpdate.build(new JobUpdate()
        .setSummary(new JobUpdateSummary()
            .setJobKey(JOB_KEY.newBuilder())
            .setUpdateId(UPDATE_ID)
            .setUser(ROLE_IDENTITY.getUser()))
        .setInstructions(new JobUpdateInstructions()
View Full Code Here

    RemoveLock removeLock = new RemoveLock(LockKey.job(JOB_KEY.newBuilder()));
    builder.add(createTransaction(Op.removeLock(removeLock)));
    storageUtil.lockStore.removeLock(ILockKey.build(removeLock.getLockKey()));

    SaveJobUpdate saveUpdate = new SaveJobUpdate(new JobUpdate(), "token");
    builder.add(createTransaction(Op.saveJobUpdate(saveUpdate)));
    storageUtil.jobUpdateStore.saveJobUpdate(
        IJobUpdate.build(saveUpdate.getJobUpdate()),
        Optional.of(saveUpdate.getLockToken()));
View Full Code Here

  }

  private void saveAndAssertJobUpdate(final String updateId, final Optional<String> lockToken)
      throws Exception {

    final IJobUpdate update = IJobUpdate.build(new JobUpdate()
        .setSummary(new JobUpdateSummary()
            .setUpdateId(updateId)
            .setJobKey(JOB_KEY.newBuilder())
            .setUser("user"))
        .setInstructions(new JobUpdateInstructions()
View Full Code Here

    assertUpdate(update2);
  }

  @Test
  public void testSaveNullInitialState() {
    JobUpdate builder = makeJobUpdate(JOB, "u1").newBuilder();
    builder.getInstructions().unsetInitialState();

    // Save with null initial state instances.
    saveUpdate(IJobUpdate.build(builder), Optional.of("lock"));

    builder.getInstructions().setInitialState(ImmutableSet.<InstanceTaskConfig>of());
    assertUpdate(IJobUpdate.build(builder));
  }
View Full Code Here

    assertUpdate(IJobUpdate.build(builder));
  }

  @Test
  public void testSaveNullDesiredState() {
    JobUpdate builder = makeJobUpdate(JOB, "u1").newBuilder();
    builder.getInstructions().unsetDesiredState();

    // Save with null desired state instances.
    saveUpdate(IJobUpdate.build(builder), Optional.of("lock"));

    assertUpdate(IJobUpdate.build(builder));
View Full Code Here

TOP

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

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.