Package org.apache.flink.compiler.plandump

Examples of org.apache.flink.compiler.plandump.PlanJSONDumpGenerator


  public String getOptimizerPlanAsJSON(Plan plan) throws Exception {
    JobWithJars p = new JobWithJars(plan, this.jarFiles);
    Client c = new Client(this.address, new Configuration(), p.getUserCodeClassLoader());
   
    OptimizedPlan op = c.getOptimizedPlan(p, -1);
    PlanJSONDumpGenerator jsonGen = new PlanJSONDumpGenerator();
    return jsonGen.getOptimizerPlanAsJSON(op);
  }
View Full Code Here


   * @throws Exception
   */
  public String getOptimizerPlanAsJSON(Plan plan) throws Exception {
    PactCompiler pc = new PactCompiler(new DataStatistics());
    OptimizedPlan op = pc.compile(plan);
    PlanJSONDumpGenerator gen = new PlanJSONDumpGenerator();
 
    return gen.getOptimizerPlanAsJSON(op);
  }
View Full Code Here

    LocalExecutor exec = new LocalExecutor();
    try {
      exec.start();
      PactCompiler pc = new PactCompiler(new DataStatistics());
      OptimizedPlan op = pc.compile(plan);
      PlanJSONDumpGenerator gen = new PlanJSONDumpGenerator();

      return gen.getOptimizerPlanAsJSON(op);
    } finally {
      exec.stop();
    }
  }
View Full Code Here

   *
   * @param plan The program plan.
   * @return The plan as a JSON object.
   */
  public static String getPlanAsJSON(Plan plan) {
    PlanJSONDumpGenerator gen = new PlanJSONDumpGenerator();
    List<DataSinkNode> sinks = PactCompiler.createPreOptimizedPlan(plan);
    return gen.getPactPlanAsJSON(sinks);
  }
View Full Code Here

   
    PactCompiler pc = new PactCompiler(new DataStatistics());
    OptimizedPlan op = pc.compile(p);
   
    if (printPlan) {
      System.out.println(new PlanJSONDumpGenerator().getOptimizerPlanAsJSON(op));
    }

    NepheleJobGraphGenerator jgg = new NepheleJobGraphGenerator();
    return jgg.compileJobGraph(op);
  }
View Full Code Here

     
      Client client = new Client(mockJmAddress, new Configuration(), getClass().getClassLoader());
      OptimizedPlan op = client.getOptimizedPlan(prg, -1);
      assertNotNull(op);
     
      PlanJSONDumpGenerator dumper = new PlanJSONDumpGenerator();
      assertNotNull(dumper.getOptimizerPlanAsJSON(op));
     
      // test HTML escaping
      PlanJSONDumpGenerator dumper2 = new PlanJSONDumpGenerator();
      dumper2.setEncodeForHTML(true);
      String htmlEscaped = dumper2.getOptimizerPlanAsJSON(op);
     
      assertEquals(-1, htmlEscaped.indexOf('\\'));
    }
    catch (Exception e) {
      e.printStackTrace();
View Full Code Here

        // dump the job to a JSON file
        String planName = uid + ".json";
        File jsonFile = new File(this.planDumpDirectory, planName);
       
        PlanJSONDumpGenerator jsonGen = new PlanJSONDumpGenerator();
        jsonGen.setEncodeForHTML(true);
        jsonGen.dumpOptimizerPlanAsJSON(optPlan, jsonFile);

        // submit the job only, if it should not be suspended
        if (!suspend) {
          try {
            client.run(program, optPlan, false);
View Full Code Here

TOP

Related Classes of org.apache.flink.compiler.plandump.PlanJSONDumpGenerator

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.