Package eu.stratosphere.nephele.jobgraph

Examples of eu.stratosphere.nephele.jobgraph.JobGraph


      failingWorkers = args[12];
      failingIteration = Integer.parseInt(args[13]);
      messageLoss = Double.parseDouble(args[14]);
    }

    JobGraph jobGraph = new JobGraph("CompensatableDanglingPageRank");
   
    // --------------- the inputs ---------------------

    // page rank input
    JobInputVertex pageWithRankInput = JobGraphUtils.createInput(new ImprovedDanglingPageRankInputFormat(),
View Full Code Here


   * @param program
   *        Optimized PACT plan that is translated into a JobGraph.
   * @return JobGraph generated from PACT plan.
   */
  public JobGraph compileJobGraph(OptimizedPlan program) {
    this.jobGraph = new JobGraph(program.getJobName());
    this.vertices = new HashMap<PlanNode, AbstractJobVertex>();
    this.chainedTasks = new HashMap<PlanNode, TaskInChain>();
    this.chainedTasksInSequence = new ArrayList<TaskInChain>();
    this.auxVertices = new ArrayList<AbstractJobVertex>();
    this.iterations = new HashMap<IterationPlanNode, IterationDescriptor>();
    this.maxDegreeVertex = null;
   
    // generate Nephele job graph
    program.accept(this);
   
    // finalize the iterations
    for (IterationDescriptor iteration : this.iterations.values()) {
      if (iteration.getIterationNode() instanceof BulkIterationPlanNode) {
        finalizeBulkIteration(iteration);
      } else if (iteration.getIterationNode() instanceof WorksetIterationPlanNode) {
        finalizeWorksetIteration(iteration);
      } else {
        throw new CompilerException();
      }
    }
   
    // now that the traversal is done, we have the chained tasks write their configs into their
    // parents' configurations
    for (int i = 0; i < this.chainedTasksInSequence.size(); i++) {
      TaskInChain tic = this.chainedTasksInSequence.get(i);
      TaskConfig t = new TaskConfig(tic.getContainingVertex().getConfiguration());
      t.addChainedTask(tic.getChainedTask(), tic.getTaskConfig(), tic.getTaskName());
    }

    // now that all have been created, make sure that all share their instances with the one
    // with the highest degree of parallelism
    if (program.getInstanceTypeName() != null) {
      this.maxDegreeVertex.setInstanceType(program.getInstanceTypeName());
    } else {
      LOG.warn("No instance type assigned to JobVertex.");
    }
    for (AbstractJobVertex vertex : this.vertices.values()) {
      if (vertex != this.maxDegreeVertex) {
        vertex.setVertexToShareInstancesWith(this.maxDegreeVertex);
      }
    }
   
    for (AbstractJobVertex vertex : this.auxVertices) {
      if (vertex != this.maxDegreeVertex) {
        vertex.setVertexToShareInstancesWith(this.maxDegreeVertex);
      }
    }

    // add registered cache file into job configuration
    for (Entry<String, String> e: program.getOriginalPactPlan().getCachedFiles()) {
      DistributedCache.addCachedFile(e.getKey(), e.getValue(), this.jobGraph.getJobConfiguration());
    }
    JobGraph graph = this.jobGraph;

    // release all references again
    this.maxDegreeVertex = null;
    this.vertices = null;
    this.chainedTasks = null;
View Full Code Here

  }

  private JobGraph getTestJobGraph(String inputPath, String outputPath, int numSubTasks, int maxIterations)
      throws JobGraphDefinitionException {

    final JobGraph jobGraph = new JobGraph("Iteration Tail with Chaining");

    final TypeSerializerFactory<Record> serializer = RecordSerializerFactory.get();

    @SuppressWarnings("unchecked")
    final TypeComparatorFactory<Record> comparator =
View Full Code Here

    public JobExecutionResult execute(String jobName) throws Exception {
      try {
        OptimizedPlan op = compileProgram(jobName);
       
        NepheleJobGraphGenerator jgg = new NepheleJobGraphGenerator();
        JobGraph jobGraph = jgg.compileJobGraph(op);

        JobClient client = this.executor.getJobClient(jobGraph);
        client.setConsoleStreamForReporting(AbstractTestBase.getNullPrintStream());
        JobExecutionResult result = client.submitJobAndWait();
       
View Full Code Here

      e.printStackTrace();
      Assert.fail("Pre-submit work caused an error: " + e.getMessage());
    }
   
    // submit job
    JobGraph jobGraph = null;
    try {
      jobGraph = getJobGraph();
    }
    catch(Exception e) {
      System.err.println(e.getMessage());
View Full Code Here

    // -- init -------------------------------------------------------------------------------------------------
    final TypeSerializerFactory<?> serializer = RecordSerializerFactory.get();
    @SuppressWarnings("unchecked")
    final TypeComparatorFactory<?> int0Comparator = new RecordComparatorFactory(new int[] { 0 }, new Class[] { IntValue.class });

    JobGraph jobGraph = new JobGraph("KMeans Iterative");

    // -- vertices ---------------------------------------------------------------------------------------------
    JobInputVertex points = createPointsInput(jobGraph, pointsPath, numSubTasks, serializer);
    JobInputVertex centers = createCentersInput(jobGraph, centersPath, numSubTasks, serializer);
   
View Full Code Here

      failingWorkers = args[12];
      failingIteration = Integer.parseInt(args[13]);
      messageLoss = Double.parseDouble(args[14]);
    }

    JobGraph jobGraph = new JobGraph("CompensatableDanglingPageRank");
   
    // --------------- the inputs ---------------------

    // page rank input
    JobInputVertex pageWithRankInput = JobGraphUtils.createInput(new CustomImprovedDanglingPageRankInputFormat(),
View Full Code Here

    try {
      inputFile = ServerTestUtils.createInputFile(0);

      // create job graph
      final JobGraph jg = new JobGraph("Job Graph 1");
      jobID = jg.getJobID();

      // input vertex
      final JobFileInputVertex i1 = new JobFileInputVertex("Input 1", jg);
      i1.setFileInputClass(FileLineReader.class);
      i1.setFilePath(new Path(inputFile.toURI()));
View Full Code Here

    try {
      inputFile = ServerTestUtils.createInputFile(0);

      // create job graph
      final JobGraph jg = new JobGraph("Job Graph 1");
      jobID = jg.getJobID();

      // input vertex
      final JobFileInputVertex i1 = new JobFileInputVertex("Input 1", jg);
      i1.setFileInputClass(FileLineReader.class);
      i1.setFilePath(new Path(inputFile.toURI()));
View Full Code Here

      inputFile1 = ServerTestUtils.createInputFile(0);
      inputFile2 = ServerTestUtils.createInputFile(0);
      outputFile = new File(ServerTestUtils.getRandomFilename());

      // create job graph
      final JobGraph jg = new JobGraph("Job Graph 1");
      jobID = jg.getJobID();

      // input vertex
      final JobFileInputVertex i1 = new JobFileInputVertex("Input 1", jg);
      i1.setFileInputClass(FileLineReader.class);
      i1.setFilePath(new Path(inputFile1.toURI()));
View Full Code Here

TOP

Related Classes of eu.stratosphere.nephele.jobgraph.JobGraph

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.