Package org.apache.aurora.gen

Examples of org.apache.aurora.gen.ResourceAggregate


        quotaManager.getQuotaInfo(ROLE));
  }

  @Test
  public void testCheckQuotaUpdateInitialConfigsUsedForFiltering() {
    expectQuota(IResourceAggregate.build(new ResourceAggregate(6, 6, 6))).times(2);
    expectTasks(createProdTask("foo", 2, 2, 2), createProdTask(JOB_NAME, 2, 2, 2)).times(2);

    String updateId = "u1";
    ITaskConfig config = taskConfig(2, 2, 2, true);
    List<IJobUpdateSummary> summaries = buildJobUpdateSummaries(updateId, config.getJob());
View Full Code Here


        quotaManager.getQuotaInfo(ROLE));
  }

  @Test
  public void testCheckQuotaUpdateDesiredConfigsUsedForFiltering() {
    expectQuota(IResourceAggregate.build(new ResourceAggregate(6, 6, 6))).times(2);
    expectTasks(createProdTask("foo", 2, 2, 2), createProdTask(JOB_NAME, 2, 2, 2)).times(2);

    String updateId = "u1";
    ITaskConfig config = taskConfig(2, 2, 2, true);
    List<IJobUpdateSummary> summaries = buildJobUpdateSummaries(updateId, config.getJob());
View Full Code Here

        quotaManager.getQuotaInfo(ROLE));
  }

  @Test
  public void testCheckQuotaNoDesiredState() {
    expectQuota(IResourceAggregate.build(new ResourceAggregate(6, 6, 6))).times(2);
    expectTasks(createProdTask("foo", 2, 2, 2), createProdTask("bar", 2, 2, 2)).times(2);

    String updateId = "u1";
    ITaskConfig config = taskConfig(2, 2, 2, true);
    List<IJobUpdateSummary> summaries = buildJobUpdateSummaries(updateId, config.getJob());
View Full Code Here

        quotaManager.getQuotaInfo(ROLE));
  }

  @Test
  public void testCheckQuotaNewInPlaceUpdate() {
    expectQuota(IResourceAggregate.build(new ResourceAggregate(6, 6, 6))).times(2);
    expectTasks(
        createProdTask("foo", 2, 2, 2),
        createTask(JOB_NAME, "id1", 2, 2, 2, true, 0),
        createTask(JOB_NAME, "id12", 2, 2, 2, true, 12)).times(2);
    expectNoJobUpdates().times(2);
View Full Code Here

        quotaManager.getQuotaInfo(ROLE));
  }

  @Test
  public void testCheckQuotaNewUpdateAddsInstances() {
    expectQuota(IResourceAggregate.build(new ResourceAggregate(6, 6, 6))).times(2);
    expectTasks(createProdTask("foo", 2, 2, 2), createProdTask(JOB_NAME, 2, 2, 2)).times(2);
    expectNoJobUpdates().times(2);

    ITaskConfig config = taskConfig(2, 2, 2, true);
    IJobUpdate update = buildJobUpdate(
View Full Code Here

        quotaManager.getQuotaInfo(ROLE));
  }

  @Test
  public void testCheckQuotaNewUpdateRemovesInstances() {
    expectQuota(IResourceAggregate.build(new ResourceAggregate(6, 6, 6))).times(2);
    expectTasks(
        createProdTask("foo", 2, 2, 2),
        createTask(JOB_NAME, "id1", 2, 2, 2, true, 0),
        createTask(JOB_NAME, "id2", 2, 2, 2, true, 1)).times(2);
    expectNoJobUpdates().times(2);
View Full Code Here

  }

  @Test(expected = QuotaException.class)
  public void testSaveQuotaFailsMissingSpecs() throws Exception {
    control.replay();
    quotaManager.saveQuota(ROLE, IResourceAggregate.build(new ResourceAggregate()));
  }
View Full Code Here

  }

  @Test(expected = QuotaException.class)
  public void testSaveQuotaFailsNegativeValues() throws Exception {
    control.replay();
    quotaManager.saveQuota(ROLE, IResourceAggregate.build(new ResourceAggregate(-2.0, 4, 5)));
  }
View Full Code Here

        .setTaskConfig(task)
        .setInstanceCount(instanceCount));
  }

  private static IResourceAggregate from(double cpu, int ramMb, int diskMb) {
    return IResourceAggregate.build(new ResourceAggregate(cpu, ramMb, diskMb));
  }
View Full Code Here

  public void testComputeQuotaAllocationTotals() {
    storage.write(new Storage.MutateWork.NoResult.Quiet() {
      @Override
      protected void execute(Storage.MutableStoreProvider storeProvider) {
        storeProvider.getQuotaStore()
            .saveQuota("a", IResourceAggregate.build(new ResourceAggregate(1, 1, 1)));
        storeProvider.getQuotaStore()
            .saveQuota("b", IResourceAggregate.build(new ResourceAggregate(2, 3, 4)));
      }
    });

    assertEquals(new Metric(3, 4, 5), resourceCounter.computeQuotaAllocationTotals());
  }
View Full Code Here

TOP

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

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.