Package org.apache.flink.client.program

Examples of org.apache.flink.client.program.Client


      String jarFile = JAR_FILE;
      String testData = getClass().getResource(TEST_DATA_FILE).toString();
     
      PackagedProgram program = new PackagedProgram(new File(jarFile), new String[] { testData });
           
      Client c = new Client(new InetSocketAddress("localhost", testMiniCluster.getJobManagerRpcPort()), new Configuration(), program.getUserCodeClassLoader());
      c.run(program, 4, true);
    }
    catch (Throwable t) {
      System.err.println(t.getMessage());
      t.printStackTrace();
      Assert.fail("Error during the packaged program execution: " + t.getMessage());
View Full Code Here


      }
      jobGraph.addJar(new Path(file.getAbsolutePath()));
    }

    Configuration configuration = jobGraph.getJobConfiguration();
    Client client = new Client(new InetSocketAddress(host, port), configuration, getClass().getClassLoader());

    try {
      client.run(jobGraph, true);
    } catch (ProgramInvocationException e) {
      throw new RuntimeException("Cannot execute job due to ProgramInvocationException", e);
    }
  }
View Full Code Here

    }

    try {
      exec.start();

      Client client = new Client(new InetSocketAddress("localhost",
          exec.getJobManagerRpcPort()), configuration, ClusterUtil.class.getClassLoader());
      client.run(jobGraph, true);
    } catch (ProgramInvocationException e) {
      if (e.getMessage().contains("GraphConversionException")) {
        throw new Exception(CANNOT_EXECUTE_EMPTY_JOB, e);
      } else {
        throw e;
View Full Code Here

  @Override
  public JobExecutionResult executePlan(Plan plan) throws Exception {
    JobWithJars p = new JobWithJars(plan, this.jarFiles);
   
    Client c = new Client(this.address, new Configuration(), p.getUserCodeClassLoader());
    return c.run(p, -1, true);
  }
View Full Code Here

    Client c = new Client(this.address, new Configuration(), p.getUserCodeClassLoader());
    return c.run(p, -1, true);
  }
 
  public JobExecutionResult executePlanWithJars(JobWithJars p) throws Exception {
    Client c = new Client(this.address, new Configuration(), p.getUserCodeClassLoader());
    return c.run(p, -1, true);
  }
View Full Code Here

  public JobExecutionResult executeJar(String jarPath, String assemblerClass, String[] args) throws Exception {
    File jarFile = new File(jarPath);
    PackagedProgram program = new PackagedProgram(jarFile, assemblerClass, args);
   
    Client c = new Client(this.address, new Configuration(), program.getUserCodeClassLoader());
    return c.run(program.getPlanWithJars(), -1, true);
  }
View Full Code Here

  }

  @Override
  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

      Assert.assertArrayEquals(new String[]{"some", "program"}, prog.getArguments());
      Assert.assertEquals(TEST_JAR_CLASSLOADERTEST_CLASS, prog.getMainClassName());

      Configuration c = new Configuration();
      c.setString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY, "devil");
      Client cli = new Client(c, getClass().getClassLoader());
     
      cli.getOptimizedPlanAsJson(prog, 666);
    }
    catch(ProgramInvocationException pie) {
      assertTrue("Classloader was not called", callme[0]);
      // class not found exception is expected as some point
      if( ! ( pie.getCause() instanceof ClassNotFoundException ) ) {
View Full Code Here

      if (program == null) {
        printHelpForRun();
        return 1;
      }
     
      Client client = getClient(line, program.getUserCodeClassLoader());
      if (client == null) {
        printHelpForRun();
        return 1;
      }
   
View Full Code Here

        }
      }
     
      // check for json plan request
      if (plan) {
        Client client = getClient(line, program.getUserCodeClassLoader());
        String jsonPlan = client.getOptimizedPlanAsJson(program, parallelism);
       
        if (jsonPlan != null) {
          System.out.println("----------------------- Execution Plan -----------------------");
          System.out.println(jsonPlan);
          System.out.println("--------------------------------------------------------------");
View Full Code Here

TOP

Related Classes of org.apache.flink.client.program.Client

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.