Package eu.stratosphere.api.common

Examples of eu.stratosphere.api.common.JobExecutionResult


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


        NepheleJobGraphGenerator jgg = new NepheleJobGraphGenerator();
        JobGraph jobGraph = jgg.compileJobGraph(op);

        JobClient client = this.executor.getJobClient(jobGraph);
        client.setConsoleStreamForReporting(AbstractTestBase.getNullPrintStream());
        JobExecutionResult result = client.submitJobAndWait();
       
        this.latestResult = result;
        return result;
      }
      catch (Exception e) {
View Full Code Here

   */
  public static void main(String[] args) throws Exception {

    prepareTestDb();
    JDBCExample tut = new JDBCExample();
    JobExecutionResult res = LocalExecutor.execute(tut, args);
    System.out.println("runtime: " + res.getNetRuntime());

    System.exit(0);
  }
View Full Code Here

  protected void postSubmit() throws Exception {
    compareResultsByLinesInMemory(EXPECTED, resultPath);
   
    // Test accumulator results
    System.out.println("Accumulator results:");
    JobExecutionResult res = getJobExecutionResult();
    System.out.println(AccumulatorHelper.getResultsFormated(res.getAllAccumulatorResults()));
   
    Assert.assertEquals(new Integer(3), (Integer) res.getAccumulatorResult("num-lines"));

    Assert.assertEquals(new Double(NUM_SUBTASKS), (Double)res.getAccumulatorResult("open-close-counter"));
   
    // Test histogram (words per line distribution)
    Map<Integer, Integer> dist = Maps.newHashMap();
    dist.put(1, 1); dist.put(2, 2); dist.put(3, 3);
    Assert.assertEquals(dist, res.getAccumulatorResult("words-per-line"));
   
    // Test distinct words (custom accumulator)
    Set<StringRecord> distinctWords = Sets.newHashSet();
    distinctWords.add(new StringRecord("one"));
    distinctWords.add(new StringRecord("two"));
    distinctWords.add(new StringRecord("three"));
    Assert.assertEquals(distinctWords, res.getAccumulatorResult("distinct-words"));
  }
View Full Code Here

      System.exit(1);
    }

    Plan plan = wc.getPlan(args);

    JobExecutionResult result = LocalExecutor.execute(plan);

    // Accumulators can be accessed by their name.
    System.out.println("Number of lines counter: "+ result.getAccumulatorResult(TokenizeLine.ACCUM_NUM_LINES));
    System.out.println("Words per line histogram: " + result.getAccumulatorResult(TokenizeLine.ACCUM_WORDS_PER_LINE));
    System.out.println("Distinct words: " + result.getAccumulatorResult(TokenizeLine.ACCUM_DISTINCT_WORDS));
  }
View Full Code Here

   
    Plan plan = wc.getPlan(args);
   
    // This will execute the word-count embedded in a local context. replace this line by the commented
    // succeeding line to send the job to a local installation or to a cluster for execution
    JobExecutionResult result = LocalExecutor.execute(plan);
    System.err.println("Total runtime: " + result.getNetRuntime());
//    PlanExecutor ex = new RemoteExecutor("localhost", 6123, "stratosphere-java-examples-0.4-WordCount.jar");
//    ex.executePlan(plan);
  }
View Full Code Here

        throw new ProgramInvocationException("The program has been canceled");
      } else {
        throw new ProgramInvocationException("The program execution failed: " + jex.getMessage());
      }
    }
    return new JobExecutionResult(-1, null);
  }
View Full Code Here

  }
 
  // --------------------------------------------------------------------------------------------
 
  protected int executeProgram(PackagedProgram program, Client client, int parallelism) {
    JobExecutionResult execResult;
    try {
      client.setPrintStatusDuringExecution(true);
      execResult = client.run(program, parallelism, true);
    }
    catch (ProgramInvocationException e) {
      return handleError(e);
    }
    finally {
      program.deleteExtractedLibraries();
    }
   
    // we come here after the job has finished
    if (execResult != null) {
      System.out.println("Job Runtime: " + execResult.getNetRuntime());
      Map<String, Object> accumulatorsResult = execResult.getAllAccumulatorResults();
      if (accumulatorsResult.size() > 0) {
        System.out.println("Accumulator Results: ");
        System.out.println(AccumulatorHelper.getResultsFormated(accumulatorsResult));
      }
    }
View Full Code Here

       
        NepheleJobGraphGenerator jgg = new NepheleJobGraphGenerator();
        JobGraph jobGraph = jgg.compileJobGraph(op);
       
        JobClient jobClient = this.nephele.getJobClient(jobGraph);
        JobExecutionResult result = jobClient.submitJobAndWait();
        return result;
      }
      finally {
        if (shutDownAtEnd) {
          stop();
View Full Code Here

TOP

Related Classes of eu.stratosphere.api.common.JobExecutionResult

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.