本文整理汇总了Java中org.apache.flink.runtime.jobgraph.JobGraph.setClasspaths方法的典型用法代码示例。如果您正苦于以下问题:Java JobGraph.setClasspaths方法的具体用法?Java JobGraph.setClasspaths怎么用?Java JobGraph.setClasspaths使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.flink.runtime.jobgraph.JobGraph
的用法示例。
在下文中一共展示了JobGraph.setClasspaths方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getJobGraph
import org.apache.flink.runtime.jobgraph.JobGraph; //导入方法依赖的package包/类
private JobGraph getJobGraph(FlinkPlan optPlan, List<URL> jarFiles, List<URL> classpaths, SavepointRestoreSettings savepointSettings) {
JobGraph job;
if (optPlan instanceof StreamingPlan) {
job = ((StreamingPlan) optPlan).getJobGraph();
job.setSavepointRestoreSettings(savepointSettings);
} else {
JobGraphGenerator gen = new JobGraphGenerator(this.flinkConfig);
job = gen.compileJobGraph((OptimizedPlan) optPlan);
}
for (URL jar : jarFiles) {
try {
job.addJar(new Path(jar.toURI()));
} catch (URISyntaxException e) {
throw new RuntimeException("URL is invalid. This should not happen.", e);
}
}
job.setClasspaths(classpaths);
return job;
}
示例2: execute
import org.apache.flink.runtime.jobgraph.JobGraph; //导入方法依赖的package包/类
@Override
public JobExecutionResult execute(String jobName) throws Exception {
OptimizedPlan op = compileProgram(jobName);
JobGraphGenerator jgg = new JobGraphGenerator();
JobGraph jobGraph = jgg.compileJobGraph(op);
for (Path jarFile: jarFiles) {
jobGraph.addJar(jarFile);
}
jobGraph.setClasspaths(new ArrayList<>(classPaths));
this.lastJobExecutionResult = jobExecutor.executeJobBlocking(jobGraph);
return this.lastJobExecutionResult;
}
示例3: execute
import org.apache.flink.runtime.jobgraph.JobGraph; //导入方法依赖的package包/类
@Override
public JobExecutionResult execute(String jobName) throws Exception {
final StreamGraph streamGraph = getStreamGraph();
streamGraph.setJobName(jobName);
final JobGraph jobGraph = streamGraph.getJobGraph();
for (Path jarFile: jarFiles) {
jobGraph.addJar(jarFile);
}
jobGraph.setClasspaths(new ArrayList<>(classPaths));
return jobExecutor.executeJobBlocking(jobGraph);
}