Package com.google.appengine.tools.pipeline.impl.tasks

Examples of com.google.appengine.tools.pipeline.impl.tasks.RunJobTask


  public void setUp() throws Exception {
    super.setUp();
    helper.setUp();
    System.setProperty(USE_SIMPLE_GUIDS_FOR_DEBUGGING, "true");
    Key key = KeyFactory.createKey(JobRecord.DATA_STORE_KIND, "job1");
    RunJobTask runJobTask = new RunJobTask(key, queueSettings1);
    key = KeyFactory.createKey(JobRecord.DATA_STORE_KIND, "job2");
    RunJobTask runJobTask2 = new RunJobTask(key, queueSettings2);
    key = KeyFactory.createKey(JobRecord.DATA_STORE_KIND, "job3");
    FinalizeJobTask finalizeJobTask = new FinalizeJobTask(key, queueSettings1);
    key = KeyFactory.createKey(Slot.DATA_STORE_KIND, "slot1");
    HandleSlotFilledTask hsfTask = new HandleSlotFilledTask(key, queueSettings2);
    listOfTasks = ImmutableList.of(runJobTask, runJobTask2, finalizeJobTask, hsfTask);
View Full Code Here


  }

  private Task createTask() {
    String name = GUIDGenerator.nextGUID();
    Key key = KeyFactory.createKey("testType", name);
    Task task = new RunJobTask(key, new QueueSettings().setModuleVersion("m1"));
    return task;
  }
View Full Code Here

      backEnd.save(updateSpec, jobRecord.getQueueSettings());
    } else {
      jobRecord.setState(State.RETRY);
      int backoffFactor = jobRecord.getBackoffFactor();
      int backoffSeconds = jobRecord.getBackoffSeconds();
      RunJobTask task =
          new RunJobTask(jobRecord.getKey(), attemptNumber, jobRecord.getQueueSettings());
      task.getQueueSettings().setDelayInSeconds(
          backoffSeconds * (long) Math.pow(backoffFactor, attemptNumber));
      updateSpec.getFinalTransaction().includeJob(jobRecord);
      updateSpec.getFinalTransaction().registerTask(task);
      backEnd.saveWithJobStateCheck(updateSpec, jobRecord.getQueueSettings(), jobRecord.getKey(),
          State.WAITING_TO_RUN, State.RETRY);
View Full Code Here

          JobRecord jobRecord = queryJobOrAbandonTask(jobKey, JobRecord.InflationType.NONE);
          jobRecord.getQueueSettings().merge(hsfTask.getQueueSettings());
          Task task;
          switch (barrier.getType()) {
            case RUN:
              task = new RunJobTask(jobKey, jobRecord.getQueueSettings());
              break;
            case FINALIZE:
              task = new FinalizeJobTask(jobKey, jobRecord.getQueueSettings());
              break;
            default:
View Full Code Here

  public static void processTask(Task task) {
    logger.finest("Processing task " + task);
    try {
      switch (task.getType()) {
      case RUN_JOB:
          RunJobTask runJobTask = (RunJobTask) task;
          runJob(runJobTask.getJobKey());
          break;
      case HANDLE_SLOT_FILLED:
          HandleSlotFilledTask hsfTask = (HandleSlotFilledTask) task;
          handleSlotFilled(hsfTask.getSlotKey());
          break;
View Full Code Here

      updateSpec.getNonTransactionalGroup().includeJob(jobRecord);
      updateSpec.getNonTransactionalGroup().includeJob(rootJobRecord);
      backEnd.save(updateSpec);
      int backoffFactor = jobRecord.getBackoffFactor();
      int backoffSeconds = jobRecord.getBackoffSeconds();
      Task task = new RunJobTask(jobRecord.getKey(), attemptNumber);
      task.setDelaySeconds(backoffSeconds * (long) Math.pow(backoffFactor, attemptNumber));
      task.setOnBackend(jobRecord.getOnBackend());
      backEnd.enqueue(task);
    }
    logger.log(Level.SEVERE, "An exception occurred while attempting to run " + jobRecord + ". "
        + "This was attempt number " + attemptNumber + " of " + maxAttempts + ".", e);

View Full Code Here

        if (shouldBeReleased) {
          Key jobKey = barrier.getJobKey();
          Task task;
          switch (barrier.getType()) {
          case RUN:
              task = new RunJobTask(jobKey);
              break;
          case FINALIZE:
              task = new FinalizeJobTask(jobKey);
              break;
          default:
View Full Code Here

TOP

Related Classes of com.google.appengine.tools.pipeline.impl.tasks.RunJobTask

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.