Package org.platformlayer.jobs.model

Examples of org.platformlayer.jobs.model.JobLog


          continue;
        }

        String executionId = execution.getExecutionId();
        try {
          JobLog jobLog = client.getJobExecutionLog(jobId, executionId);
          logs.add(jobLog);
        } catch (PlatformLayerClientNotFoundException e) {
          // TODO: Warn?
        }
      }
    } else {
      JobLog jobLog = client.getJobExecutionLog(jobId, executionId);
      logs.add(jobLog);
    }

    return logs;
  }
View Full Code Here


        executionId = last.getExecutionId();
      }
    }

    // TODO: What if executionId == null? Also retries..
    JobLog previousJobLog = null;
    int jobLogOffset = 0;

    while (true) {
      // TODO: Only fetch tail
      JobLog jobLog = client.getJobExecutionLog(jobId, executionId);
      if (previousJobLog == null) {
        jobLogPrinter.startJobLog(jobLog);
      }

      List<JobLogLine> lines = jobLog.getLines();

      if (jobLogOffset < lines.size()) {
        for (JobLogLine line : lines.subList(jobLogOffset, lines.size())) {
          jobLogPrinter.write(line);
        }
View Full Code Here

  public JobLog getJobLog(PlatformLayerKey jobKey, String executionId, int logSkip) throws OpsException {
    JobExecutionData execution = findExecution(jobKey, executionId);

    Date startedAt = execution.getStartedAt();
    if (execution.getEndedAt() == null) {
      JobLog log = operationQueue.getActiveJobLog(jobKey, executionId);
      if (log != null) {
        JobLog ret = new JobLog();
        ret.lines = Lists.newArrayList(Iterables.skip(log.lines, logSkip));
        ret.execution = log.execution;
        return ret;
      }
    }

    try {
      String cookie = execution.logCookie;
      JobLog log = jobLogStore.getJobLog(startedAt, jobKey, executionId, cookie, logSkip);
      if (log != null) {
        log.execution = execution;
      }
      return log;
    } catch (IOException e) {
View Full Code Here

    } finally {
      // Closeables.closeQuietly(in);
      Closeables.closeQuietly(is);
    }

    JobLog jobLog = new JobLog();
    jobLog.lines = lines;
    return jobLog;
  }
View Full Code Here

  @Override
  public JobLog getActiveJobLog(PlatformLayerKey jobKey, String executionId) {
    ActiveJobExecution activeJobExecution = activeJobs.get(jobKey);
    if (activeJobExecution != null) {
      SimpleJobLogger logger = (SimpleJobLogger) activeJobExecution.getLogger();
      JobLog log = new JobLog();
      log.lines = Lists.newArrayList(logger.getLogEntries());
      log.execution = activeJobExecution.getJobExecution();
      return log;
    }
View Full Code Here

  }

  @Override
  public JobLog getJobExecutionLog(String jobId, String executionId) throws PlatformLayerClientException {
    String relativePath = "jobs/" + jobId + "/runs/" + executionId + "/log";
    JobLog jobLog = doRequest(HttpMethod.GET, relativePath, JobLog.class, Format.XML, null, null);
    return jobLog;
  }
View Full Code Here

  @GET
  @Path("log")
  @Produces({ XML, JSON })
  public JobLog getLog(@QueryParam("log.skip") int logSkip) throws OpsException {
    JobLog log = jobRegistry.getJobLog(job.getJobKey(), runId, logSkip);
    if (log == null) {
      raiseNotFound();
    }

    return log;
View Full Code Here

TOP

Related Classes of org.platformlayer.jobs.model.JobLog

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.