Examples of ITaskConfig


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

        quotaManager.getQuotaInfo(ROLE));
  }

  @Test
  public void testCheckQuotaNewUpdateSkippedForNonProdDesiredState() {
    ITaskConfig config = taskConfig(2, 2, 2, false);
    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

    assertEquals(SUFFICIENT_QUOTA, checkQuota.getResult());
  }

  @Test
  public void testCheckQuotaNewUpdateSkippedForEmptyDesiredState() {
    ITaskConfig config = taskConfig(2, 2, 2, true);
    IJobUpdate update = buildJobUpdate(
        buildJobUpdateSummaries("u1", config.getJob()).get(0),
        config,
        1,
        config,
        1);
    JobUpdate updateBuilder = update.newBuilder();
View Full Code Here

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

    expect(uuidGenerator.createNew()).andReturn(UU_ID);

    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();
View Full Code Here

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

    IScheduledTask oldTask = buildScheduledTask(0, 5);
    storageUtil.expectTaskFetch(Query.unscoped().byJob(JOB_KEY).active(), oldTask);
    expect(taskIdGenerator.generate(ITaskConfig.build(request.getTaskConfig()), 6))
        .andReturn(TASK_ID);

    ITaskConfig config = ITaskConfig.build(request.getTaskConfig());
    IJobUpdate update = buildJobUpdate(6, config, ImmutableMap.of(
        oldTask.getAssignedTask().getTask(), ImmutableSet.of(new Range(0, 0))));

    expect(quotaManager.checkJobUpdate(update)).andReturn(NOT_ENOUGH_QUOTA);
View Full Code Here

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

  public void testStartUpdateFailsInController() throws Exception {
    expectAuth(ROLE, true);
    expect(cronJobManager.hasJob(JOB_KEY)).andReturn(false);

    IScheduledTask oldTask = buildScheduledTask(0, 5);
    ITaskConfig newTask = buildScheduledTask(0, 1024).getAssignedTask().getTask();

    IJobUpdate update = buildJobUpdate(1, newTask, ImmutableMap.of(
        oldTask.getAssignedTask().getTask(), ImmutableSet.of(new Range(0, 0))
    ));
View Full Code Here

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

        MutableStoreProvider storeProvider,
        StateManager stateManager,
        JobUpdateStatus status) {

      LOG.info("Adding instance " + instance + " while " + status);
      ITaskConfig replacement = getTargetConfig(
          instructions,
          status == ROLLING_FORWARD,
          instance.getInstanceId());
      stateManager.insertPendingTasks(
          storeProvider,
View Full Code Here

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

        final boolean isProd) {

      // Calculate initial state consumption.
      IResourceAggregate initial = ResourceAggregates.EMPTY;
      for (IInstanceTaskConfig group : instructions.getInitialState()) {
        ITaskConfig task = group.getTask();
        if (isProd == task.isProduction()) {
          for (IRange range : group.getInstances()) {
            initial = add(initial, ResourceAggregates.scale(
                fromTasks(ImmutableSet.of(task)),
                instanceCountFromRange(range)));
          }
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

              || cronJobManager.hasJob(job.getKey())) {

            return invalidResponse("Job already exists: " + JobKeys.canonicalString(job.getKey()));
          }

          ITaskConfig template = sanitized.getJobConfig().getTaskConfig();
          int count = sanitized.getJobConfig().getInstanceCount();

          validateTaskLimits(template, count, quotaManager.checkInstanceAddition(template, count));

          // TODO(mchucarroll): deprecate cron as a part of create/kill job.(AURORA-454)
View Full Code Here

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

      if (!sanitized.isCron()) {
        return invalidResponse(noCronScheduleMessage(jobKey));
      }

      ITaskConfig template = sanitized.getJobConfig().getTaskConfig();
      int count = sanitized.getJobConfig().getInstanceCount();

      validateTaskLimits(template, count, quotaManager.checkInstanceAddition(template, count));

      // TODO(mchucarroll): Merge CronJobManager.createJob/updateJob
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.