Package org.apache.flink.client.program

Examples of org.apache.flink.client.program.Client.run()


      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


    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);
  }
 
  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

    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);
  }

  public JobExecutionResult executeJar(String jarPath, String assemblerClass, String[] args) throws Exception {
    File jarFile = new File(jarPath);
    PackagedProgram program = new PackagedProgram(jarFile, assemblerClass, args);
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);
  }

  @Override
  public String getOptimizerPlanAsJSON(Plan plan) throws Exception {
    JobWithJars p = new JobWithJars(plan, this.jarFiles);
View Full Code Here

  @Test
  public void shouldSubmitToJobClient() throws ProgramInvocationException, IOException {
    when(jobSubmissionResultMock.getReturnCode()).thenReturn(ReturnCode.SUCCESS);

    Client out = new Client(configMock, getClass().getClassLoader());
    out.run(program.getPlanWithJars(), -1, false);
    program.deleteExtractedLibraries();

    verify(this.compilerMock, times(1)).compile(planMock);
    verify(this.generatorMock, times(1)).compileJobGraph(optimizedPlanMock);
    verify(this.jobClientMock, times(1)).submitJob();
View Full Code Here

  @Test(expected = ProgramInvocationException.class)
  public void shouldThrowException() throws Exception {
    when(jobSubmissionResultMock.getReturnCode()).thenReturn(ReturnCode.ERROR);

    Client out = new Client(configMock, getClass().getClassLoader());
    out.run(program.getPlanWithJars(), -1, false);
    program.deleteExtractedLibraries();

    verify(this.jobClientMock).submitJob();
  }
View Full Code Here

        jsonGen.dumpOptimizerPlanAsJSON(optPlan, jsonFile);

        // submit the job only, if it should not be suspended
        if (!suspend) {
          try {
            client.run(program, optPlan, false);
          } catch (Throwable t) {
            LOG.error("Error submitting job to the job-manager.", t);
            showErrorPage(resp, t.getMessage());
            return;
          } finally {
View Full Code Here

        resp.sendRedirect("showPlan?id=" + uid + "&suspended=" + (suspend ? "true" : "false"));
      } else {
        // don't show any plan. directly submit the job and redirect to the
        // nephele runtime monitor
        try {
          client.run(program, -1, false);
        } catch (Exception ex) {
          LOG.error("Error submitting job to the job-manager.", ex);
          // HACK: Is necessary because Message contains whole stack trace
          String errorMessage = ex.getMessage().split("\n")[0];
          showErrorPage(resp, errorMessage);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.