private <T> void deployJobOnNewCluster( ClusterDescriptor<T> clusterDescriptor, JobGraph jobGraph, Result<T> result, ClassLoader classLoader) throws Exception { ClusterClient<T> clusterClient = null; try { // deploy job cluster with job attached clusterClient = clusterDescriptor.deployJobCluster(context.getClusterSpec(), jobGraph, false); // save information about the new cluster result.setClusterInformation(clusterClient.getClusterId(), clusterClient.getWebInterfaceURL()); // get result if (awaitJobResult) { // we need to hard cast for now final JobExecutionResult jobResult = ((RestClusterClient<T>) clusterClient) .requestJobResult(jobGraph.getJobID()) .get() .toJobExecutionResult(context.getClassLoader()); // throws exception if job fails executionResultBucket.add(jobResult); } } finally { try { if (clusterClient != null) { clusterClient.shutdown(); } } catch (Exception e) { // ignore } } }
System.out.println("JobManager Web Interface: " + clusterClient.getWebInterfaceURL());
webInterfaceUrl = clusterClient.getWebInterfaceURL(); } catch (Exception e) { webInterfaceUrl = "N/A";
final URI webURI = new URI(clusterClient.getWebInterfaceURL());
public static void main(String[] args) throws Exception { LauncherOptions launcherOptions = new LauncherOptionParser(args).getLauncherOptions(); String mode = launcherOptions.getMode(); List<String> argList = initFlinkxArgList(launcherOptions); if(mode.equals(ClusterMode.local.name())) { String[] localArgs = argList.toArray(new String[argList.size()]); com.dtstack.flinkx.Main.main(localArgs); } else { ClusterClient clusterClient = ClusterClientFactory.createClusterClient(launcherOptions); String monitor = clusterClient.getWebInterfaceURL(); argList.add("-monitor"); argList.add(monitor); String pluginRoot = launcherOptions.getPlugin(); String content = launcherOptions.getJob(); File jarFile = new File(pluginRoot + File.separator + "flinkx.jar"); List<URL> urlList = analyzeUserClasspath(content, pluginRoot); String[] remoteArgs = argList.toArray(new String[argList.size()]); PackagedProgram program = new PackagedProgram(jarFile, urlList, remoteArgs); clusterClient.run(program, launcherOptions.getParallelism()); clusterClient.shutdown(); } } }
System.out.println("JobManager Web Interface: " + clusterClient.getWebInterfaceURL());
System.out.println("JobManager Web Interface: " + clusterClient.getWebInterfaceURL());
logAndSysout("JobManager web interface address " + client.getWebInterfaceURL()); return client;