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

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


      } else {
        if (null != jobRecord.getExceptionHandlingAncestorKey()) {
          cancelChildren(jobRecord, null);
          // current job doesn't have an error handler. So just delegate it to the
          // nearest ancestor that has one.
          Task handleChildExceptionTask = new HandleChildExceptionTask(
              jobRecord.getExceptionHandlingAncestorKey(), jobRecord.getKey(),
              jobRecord.getQueueSettings());
          updateSpec.getFinalTransaction().registerTask(handleChildExceptionTask);
        } else {
          rootJobRecord.setState(State.STOPPED);
View Full Code Here


        }
        if (shouldBeReleased) {
          Key jobKey = barrier.getJobKey();
          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:
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

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

  public static final String TASK_NAME_REQUEST_HEADER = "X-AppEngine-TaskName";
  public static final String TASK_RETRY_COUNT_HEADER = "X-AppEngine-TaskRetryCount";

  public static void doPost(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException {
    Task task = null;
    int retryCount = -1;
    try {
      retryCount = Integer.parseInt(req.getHeader(TASK_RETRY_COUNT_HEADER));
    } catch (Exception e) {
      // ignore
View Full Code Here

    while (paramNames.hasMoreElements()) {
      String paramName = (String) paramNames.nextElement();
      String paramValue = request.getParameter(paramName);
      properties.setProperty(paramName, paramValue);
    }
    Task task = Task.fromProperties(properties);
    String taskName = request.getHeader(TASK_NAME_REQUEST_HEADER);
    task.setName(taskName);
    return task;
  }
View Full Code Here

TOP

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

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.