Examples of IJobUpdate


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

  @Test
  public void testSaveJobUpdateNullInstanceOverrides() {
    String updateId = "u1";

    IJobUpdate update = makeJobUpdate(JOB, updateId);
    JobUpdate builder = update.newBuilder();
    builder.getInstructions().getSettings().setUpdateOnlyTheseInstances(ImmutableSet.<Range>of());

    IJobUpdate expected = IJobUpdate.build(builder);

    // Save with null overrides.
    builder.getInstructions().getSettings().setUpdateOnlyTheseInstances(null);
    saveUpdate(IJobUpdate.build(builder), Optional.of("lock"));
    assertUpdate(expected);
View Full Code Here

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

  public void testRecoverFromStorage() throws Exception {
    expectTaskKilled().times(2);

    control.replay();

    final IJobUpdate update =
        setInstanceCount(makeJobUpdate(makeInstanceConfig(0, 1, OLD_CONFIG)), 2);
    insertInitialTasks(update);
    changeState(JOB, 0, ASSIGNED, STARTING, RUNNING);
    changeState(JOB, 1, ASSIGNED, STARTING, RUNNING);
    clock.advance(ONE_DAY);
View Full Code Here

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

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

    final IJobUpdate update =
        setInstanceCount(makeJobUpdate(makeInstanceConfig(0, 1, OLD_CONFIG)), 0);

    storage.write(new NoResult.Quiet() {
      @Override
      protected void execute(Storage.MutableStoreProvider storeProvider) {
View Full Code Here

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

  }

  @Test(expected = StorageException.class)
  public void testSaveJobUpdateTwiceThrows() {
    String updateId = "u1";
    IJobUpdate update = makeJobUpdate(JOB, updateId);

    saveUpdate(update, Optional.of("lock1"));
    saveUpdate(update, Optional.of("lock2"));
  }
View Full Code Here

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

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

    final IJobUpdate update = makeJobUpdate(makeInstanceConfig(0, 2, NEW_CONFIG));
    insertInitialTasks(update);
    changeState(JOB, 0, ASSIGNED, STARTING, RUNNING);
    changeState(JOB, 1, ASSIGNED, STARTING, RUNNING);
    changeState(JOB, 2, ASSIGNED, STARTING, RUNNING);
    clock.advance(ONE_DAY);
View Full Code Here

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

  @Test(expected = IllegalArgumentException.class)
  public void testNoopUpdateEmptyDiff() throws Exception {
    control.replay();

    final IJobUpdate update = makeJobUpdate();
    JobUpdate builder = update.newBuilder();
    builder.getInstructions().unsetDesiredState();

    updater.start(IJobUpdate.build(builder), USER);
  }
View Full Code Here

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

  @Test
  public void testSaveJobEvents() {
    String updateId = "u3";
    String user = "test";
    IJobUpdate update = makeJobUpdate(JOB, updateId);
    IJobUpdateEvent event1 = makeJobUpdateEvent(ROLLING_FORWARD, 124L, user);
    IJobUpdateEvent event2 = makeJobUpdateEvent(ROLL_FORWARD_PAUSED, 125L, user);

    saveUpdate(update, Optional.of("lock1"));
    assertUpdate(update);
View Full Code Here

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

  }

  @Test
  public void testSaveInstanceEvents() {
    String updateId = "u3";
    IJobUpdate update = makeJobUpdate(JOB, updateId);
    IJobInstanceUpdateEvent event1 = makeJobInstanceEvent(0, 125L, INSTANCE_UPDATED);
    IJobInstanceUpdateEvent event2 = makeJobInstanceEvent(1, 126L, INSTANCE_ROLLING_BACK);

    saveUpdate(update, Optional.of("lock"));
    assertUpdate(update);
View Full Code Here

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

  }

  @Test
  public void testSaveJobUpdateStateIgnored() {
    String updateId = "u1";
    IJobUpdate update = populateExpected(makeJobUpdate(JOB, updateId), ABORTED, 567L, 567L);
    saveUpdate(update, Optional.of("lock1"));

    // Assert state fields were ignored.
    assertUpdate(update);
  }
View Full Code Here

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

  public void testStuckTask() throws Exception {
    expectTaskKilled().times(3);

    control.replay();

    IJobUpdate update = setInstanceCount(makeJobUpdate(makeInstanceConfig(0, 1, OLD_CONFIG)), 2);
    insertInitialTasks(update);
    changeState(JOB, 0, ASSIGNED, STARTING, RUNNING);
    changeState(JOB, 1, ASSIGNED, STARTING, RUNNING);

    ImmutableMultimap.Builder<Integer, JobUpdateAction> actions = ImmutableMultimap.builder();
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.