Examples of newBuilder()


Examples of org.apache.aurora.scheduler.storage.entities.IJobUpdateEvent.newBuilder()

      @Override
      protected void setupExpectations() throws Exception {
        storageUtil.expectWriteOperation();
        storageUtil.jobUpdateStore.saveJobUpdateEvent(event, UPDATE_ID);
        streamMatcher.expectTransaction(Op.saveJobUpdateEvent(new SaveJobUpdateEvent(
            event.newBuilder(),
            UPDATE_ID))).andReturn(position);
      }

      @Override
      protected void performMutations(MutableStoreProvider storeProvider) {
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.entities.IJobUpdateSettings.newBuilder()

              "updateOnlyTheseInstances contains instances irrelevant to the update: "
                  + invalidScope);
        }

        JobUpdateInstructions instructions = new JobUpdateInstructions()
            .setSettings(settings.newBuilder())
            .setInitialState(buildInitialState(diff.getReplacedInstances()));
        if (!diff.getReplacementInstances().isEmpty()) {
          instructions.setDesiredState(
              new InstanceTaskConfig()
                  .setTask(request.getTaskConfig().newBuilder())
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.entities.ILock.newBuilder()

  @Test
  public void testValidateLockStoredNotEqualHeld() throws Exception {
    expectLockException(JOB_KEY);
    ILock lock = lockManager.acquireLock(LOCK_KEY, USER);
    lock = ILock.build(lock.newBuilder().setUser("bob"));
    lockManager.validateIfLocked(LOCK_KEY, Optional.of(lock));
  }

  @Test
  public void testValidateLockStoredNotEqualHeldWithHeldNull() throws Exception {
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.entities.ILock.newBuilder()

    new MutationFixture() {
      @Override
      protected void setupExpectations() throws Exception {
        storageUtil.expectWriteOperation();
        storageUtil.lockStore.saveLock(lock);
        streamMatcher.expectTransaction(Op.saveLock(new SaveLock(lock.newBuilder())))
            .andReturn(position);
      }

      @Override
      protected void performMutations(MutableStoreProvider storeProvider) {
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.entities.ILock.newBuilder()

          session,
          ImmutableSet.of(getRoleFromLockKey(lockKey)));

      ILock lock = lockManager.acquireLock(lockKey, context.getIdentity());
      response.setResult(Result.acquireLockResult(
          new AcquireLockResult().setLock(lock.newBuilder())));

      return response.setResponseCode(OK);
    } catch (AuthFailedException e) {
      return addMessage(response, AUTH_FAILED, e);
    } catch (LockException e) {
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.entities.ILockKey.newBuilder()

    new MutationFixture() {
      @Override
      protected void setupExpectations() throws Exception {
        storageUtil.expectWriteOperation();
        storageUtil.lockStore.removeLock(lockKey);
        streamMatcher.expectTransaction(Op.removeLock(new RemoveLock(lockKey.newBuilder())))
            .andReturn(position);
      }

      @Override
      protected void performMutations(MutableStoreProvider storeProvider) {
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.entities.IResourceAggregate.newBuilder()

    new MutationFixture() {
      @Override
      protected void setupExpectations() throws Exception {
        storageUtil.expectWriteOperation();
        storageUtil.quotaStore.saveQuota(role, quota);
        streamMatcher.expectTransaction(Op.saveQuota(new SaveQuota(role, quota.newBuilder())))
            .andReturn(position);
      }

      @Override
      protected void performMutations(MutableStoreProvider storeProvider) {
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.entities.IResourceAggregate.newBuilder()

    assertEquals(QUOTA.newBuilder(), response.getResult().getGetQuotaResult().getQuota());
    assertEquals(
        CONSUMED.newBuilder(),
        response.getResult().getGetQuotaResult().getProdConsumption());
    assertEquals(
        nonProdConsumed.newBuilder(),
        response.getResult().getGetQuotaResult().getNonProdConsumption());
  }

  private static JobConfiguration makeJob() {
    return makeJob(nonProductionTask(), 1);
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.entities.IScheduledTask.newBuilder()

    // No variables should be exported since schedulerActive is never called.
    vars = new TaskVars(storageUtil.storage, trackedStats);
    IScheduledTask taskA = makeTask(JOB_A, INIT);
    changeState(taskA, PENDING);
    changeState(IScheduledTask.build(taskA.newBuilder().setStatus(PENDING)), ASSIGNED);
  }

  private int getValue(String name) {
    return globalCounters.get(name).get().intValue();
  }
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.entities.IScheduledTask.newBuilder()

    control.replay();
    schedulerActivated();

    changeState(makeTask(JOB_A, INIT), PENDING);
    assertEquals(1, getValue(PENDING));
    changeState(IScheduledTask.build(taskA.newBuilder().setStatus(PENDING)), ASSIGNED);
    assertEquals(0, getValue(PENDING));
    assertEquals(1, getValue(ASSIGNED));
    taskA = makeTask(JOB_A, ASSIGNED, "hostA");
    changeState(IScheduledTask.build(taskA.newBuilder().setStatus(ASSIGNED)), RUNNING);
    assertEquals(0, getValue(ASSIGNED));
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.