Package eu.stratosphere.nephele.event.job

Examples of eu.stratosphere.nephele.event.job.JobEvent


        this.lastProcessedEventSequenceNumber = event.getSequenceNumber();

        // Check if we can exit the loop
        if (event instanceof JobEvent) {
          final JobEvent jobEvent = (JobEvent) event;
          final JobStatus jobStatus = jobEvent.getCurrentJobStatus();
          if (jobStatus == JobStatus.SCHEDULED) {
            startTimestamp = jobEvent.getTimestamp();
          }
          if (jobStatus == JobStatus.FINISHED) {
            Runtime.getRuntime().removeShutdownHook(this.jobCleanUp);
            final long jobDuration = jobEvent.getTimestamp() - startTimestamp;
           
            // Request accumulators
            Map<String, Object> accumulators = null;
            try {
              accumulators = AccumulatorHelper.toResultMap(getAccumulators().getAccumulators());
            } catch (IOException ioe) {
              Runtime.getRuntime().removeShutdownHook(this.jobCleanUp);
              throw ioe;  // Rethrow error
            }
            return new JobExecutionResult(jobDuration, accumulators);
           
          } else if (jobStatus == JobStatus.CANCELED || jobStatus == JobStatus.FAILED) {
            Runtime.getRuntime().removeShutdownHook(this.jobCleanUp);
            LOG.info(jobEvent.getOptionalMessage());
            if (jobStatus == JobStatus.CANCELED) {
              throw new JobExecutionException(jobEvent.getOptionalMessage(), true);
            } else {
              throw new JobExecutionException(jobEvent.getOptionalMessage(), false);
            }
          }
        }
      }
View Full Code Here


      if (jobStatus != null) {
        this.eventCollector.updateRecentJobEvent(jobID, this.jobName, this.isProfilingAvailable,
          this.submissionTimestamp, jobStatus);

        this.eventCollector.addEvent(jobID,
          new JobEvent(System.currentTimeMillis(), jobStatus, optionalMessage));
      }
    }
View Full Code Here

   */
  @Test
  public void testJobProgressResult() {

    final SerializableArrayList<AbstractEvent> events = new SerializableArrayList<AbstractEvent>();
    events.add(new JobEvent(123456L, JobStatus.FAILED, SAMPLE_DESCRIPTION));
    final JobProgressResult orig = new JobProgressResult(ReturnCode.ERROR, null, events);

    try {

      final JobProgressResult copy = (JobProgressResult) CommonTestUtils.createCopy(orig);
View Full Code Here

          lastProcessedEventSequenceNumber = event.getSequenceNumber();

          // Check if we can exit the loop
          if (event instanceof JobEvent) {
            final JobEvent jobEvent = (JobEvent) event;
            final JobStatus jobStatus = jobEvent.getCurrentJobStatus();

            switch (jobStatus) {
            case FINISHED:
              throw new IllegalStateException("Job finished successfully");
            case FAILED:
View Full Code Here

          if(first) {
            first = false;
          } else {
            wrt.write(","); }
         
          JobEvent jobevent = (JobEvent) event;
          wrt.write("{");
          wrt.write("\"newstate\": \"" + jobevent.getCurrentJobStatus() + "\",");
          wrt.write("\"timestamp\": \"" + jobevent.getTimestamp() + "\"");
          wrt.write("}");
        }
      }
     
      wrt.write("]");
View Full Code Here

TOP

Related Classes of eu.stratosphere.nephele.event.job.JobEvent

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.