Examples of ITaskConfig


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

    });

    backfill();

    // Since task fields are backfilled with defaults, additional flags should be filled.
    ITaskConfig expected = ITaskConfig.build(new TaskConfig(storedTask)
        .setProduction(false)
        .setMaxTaskFailures(1)
        .setExecutorConfig(EXECUTOR_CONFIG)
        .setConstraints(ImmutableSet.of(ConfigurationManager.hostLimitConstraint(1))));
View Full Code Here

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

      } catch (ThriftBinaryCodec.CodingException e) {
        LOG.log(Level.SEVERE, "Unable to serialize task.", e);
        throw new SchedulerException("Internal error.", e);
      }

      ITaskConfig config = task.getTask();
      // TODO(wfarner): Re-evaluate if/why we need to continue handling unset assignedPorts field.
      List<Resource> resources = Resources.from(config)
          .toResourceList(task.isSetAssignedPorts()
              ? ImmutableSet.copyOf(task.getAssignedPorts().values())
              : ImmutableSet.<Integer>of());
View Full Code Here

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

        Optional.fromNullable(Iterables.getOnlyElement(tasks, null))
            .transform(Tasks.SCHEDULED_TO_ASSIGNED);

    if (task.isPresent()) {
      if (task.get().getTask().newBuilder().equals(instanceRewrite.getOldTask())) {
        ITaskConfig newConfiguration = ITaskConfig.build(
            ConfigurationManager.applyDefaultsIfUnset(instanceRewrite.getRewrittenTask()));
        boolean changed = storeProvider.getUnsafeTaskStore().unsafeModifyInPlace(
            task.get().getTaskId(), newConfiguration);
        if (!changed) {
          error = Optional.of("Did not change " + task.get().getTaskId());
View Full Code Here

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

    IJobKey jobKey = JobKeys.assertValid(IJobKey.build(config.getKey()));

    Response resp = Util.emptyResponse();
    try {
      sessionValidator.checkAuthenticated(session, ImmutableSet.of(jobKey.getRole()));
      ITaskConfig task = ConfigurationManager.validateAndPopulate(
          ITaskConfig.build(config.getTaskConfig()));

      if (cronJobManager.hasJob(jobKey)) {
        return addMessage(resp, INVALID_REQUEST, "Instances may not be added to cron jobs.");
      }
View Full Code Here

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

  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());
    IJobUpdate update = buildJobUpdate(summaries.get(0), config, 1, config, 1);
    JobUpdate builder = update.newBuilder();
    builder.getInstructions().unsetDesiredState();

    expect(jobUpdateStore.fetchJobUpdateSummaries(updateQuery(config.getJob().getRole())))
        .andReturn(summaries).times(2);

    expect(jobUpdateStore.fetchJobUpdate(updateId))
        .andReturn(Optional.of(IJobUpdate.build(builder))).times(2);
View Full Code Here

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

  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());
    IJobUpdate update = buildJobUpdate(summaries.get(0), config, 1, config, 1);
    JobUpdate builder = update.newBuilder();
    builder.getInstructions().setInitialState(ImmutableSet.<InstanceTaskConfig>of());

    expect(jobUpdateStore.fetchJobUpdateSummaries(updateQuery(config.getJob().getRole())))
        .andReturn(summaries).times(2);

    expect(jobUpdateStore.fetchJobUpdate(updateId))
        .andReturn(Optional.of(IJobUpdate.build(builder))).times(2);
View Full Code Here

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

  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());
    IJobUpdate update = buildJobUpdate(summaries.get(0), config, 1, config, 1);
    JobUpdate builder = update.newBuilder();
    builder.getInstructions().unsetDesiredState();

    expect(jobUpdateStore.fetchJobUpdateSummaries(updateQuery(config.getJob().getRole())))
        .andReturn(summaries).times(2);

    expect(jobUpdateStore.fetchJobUpdate(updateId))
        .andReturn(Optional.of(IJobUpdate.build(builder))).times(2);
View Full Code Here

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

        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);

    ITaskConfig config = taskConfig(1, 1, 1, true);
    IJobUpdate update = buildJobUpdate(
        buildJobUpdateSummaries("u1", config.getJob()).get(0),
        taskConfig(2, 2, 2, true),
        1,
        config,
        1);
View Full Code Here

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

  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(
        buildJobUpdateSummaries("u1", config.getJob()).get(0),
        config,
        1,
        config,
        3);
View Full Code Here

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

        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);

    ITaskConfig config = taskConfig(2, 2, 2, true);
    IJobUpdate update = buildJobUpdate(
        buildJobUpdateSummaries("u1", config.getJob()).get(0),
        config,
        1,
        config,
        1);
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.