作者:生命在于创新_475 | 来源:互联网 | 2023-08-15 10:47
本文整理了Java中org.apache.flink.runtime.jobgraph.JobGraph.getUserJars()方法的一些代码示例,展示了
本文整理了Java中org.apache.flink.runtime.jobgraph.JobGraph.getUserJars()
方法的一些代码示例,展示了JobGraph.getUserJars()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JobGraph.getUserJars()
方法的具体详情如下:
包路径:org.apache.flink.runtime.jobgraph.JobGraph
类名称:JobGraph
方法名:getUserJars
JobGraph.getUserJars介绍
[英]Gets the list of assigned user jar paths.
[中]获取分配的用户jar路径的列表。
代码示例
代码示例来源:origin: apache/flink
for (Path jar : jobGraph.getUserJars()) {
jarFileNames.add(jar.getName());
filesToUpload.add(new FileUpload(Paths.get(jar.toUri()), RestConstants.CONTENT_TYPE_JAR));
代码示例来源:origin: apache/flink
for (org.apache.flink.core.fs.Path path : jobGraph.getUserJars()) {
userJarFiles.add(new File(path.toUri()));
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
/**
* Extracts all files required for the execution from the given {@link JobGraph} and uploads them using the {@link BlobClient}
* from the given {@link Supplier}.
*
* @param jobGraph jobgraph requiring files
* @param clientSupplier supplier of blob client to upload files with
* @throws FlinkException if the upload fails
*/
public static void extractAndUploadJobGraphFiles(JobGraph jobGraph, SupplierWithException clientSupplier) throws FlinkException {
List userJars = jobGraph.getUserJars();
Collection> userArtifacts = jobGraph.getUserArtifacts().entrySet().stream()
.map(entry -> Tuple2.of(entry.getKey(), new Path(entry.getValue().filePath)))
.collect(Collectors.toList());
uploadJobGraphFiles(jobGraph, userJars, userArtifacts, clientSupplier);
}
代码示例来源:origin: org.apache.flink/flink-runtime
/**
* Extracts all files required for the execution from the given {@link JobGraph} and uploads them using the {@link BlobClient}
* from the given {@link Supplier}.
*
* @param jobGraph jobgraph requiring files
* @param clientSupplier supplier of blob client to upload files with
* @throws FlinkException if the upload fails
*/
public static void extractAndUploadJobGraphFiles(JobGraph jobGraph, SupplierWithException clientSupplier) throws FlinkException {
List userJars = jobGraph.getUserJars();
Collection> userArtifacts = jobGraph.getUserArtifacts().entrySet().stream()
.map(entry -> Tuple2.of(entry.getKey(), new Path(entry.getValue().filePath)))
.collect(Collectors.toList());
uploadJobGraphFiles(jobGraph, userJars, userArtifacts, clientSupplier);
}
代码示例来源:origin: com.alibaba.blink/flink-runtime
/**
* Extracts all files required for the execution from the given {@link JobGraph} and uploads them using the {@link BlobClient}
* from the given {@link Supplier}.
*
* @param jobGraph jobgraph requiring files
* @param clientSupplier supplier of blob client to upload files with
* @throws FlinkException if the upload fails
*/
public static void extractAndUploadJobGraphFiles(JobGraph jobGraph, SupplierWithException clientSupplier) throws FlinkException {
List userJars = jobGraph.getUserJars();
Collection> userArtifacts = jobGraph.getUserArtifacts().entrySet().stream()
.map(entry -> Tuple2.of(entry.getKey(), new Path(entry.getValue().filePath)))
.collect(Collectors.toList());
uploadJobGraphFiles(jobGraph, userJars, userArtifacts, clientSupplier);
}
代码示例来源:origin: com.alibaba.blink/flink-runtime
private CompletableFuture uploadJobGraphFiles(
DispatcherGateway gateway,
CompletableFuture jobGraphFuture,
Collection jarFiles,
Collection> artifacts,
Configuration configuration) {
CompletableFuture blobServerPortFuture = gateway.getBlobServerPort(timeout);
return jobGraphFuture.thenCombine(blobServerPortFuture, (JobGraph jobGraph, Integer blobServerPort) -> {
final InetSocketAddress address = new InetSocketAddress(gateway.getHostname(), blobServerPort);
try {
// Add users jars located in dfs
for (Path path : jobGraph.getUserJars()) {
if (path.getFileSystem().isDistributedFS()) {
jarFiles.add(path);
}
}
log.info("Uploading jarFiles {} and userArtifacts {} to blob server", jarFiles.toString(), artifacts.toString());
ClientUtils.uploadJobGraphFiles(jobGraph, jarFiles, artifacts, () -> new BlobClient(address, configuration));
} catch (IOException | FlinkException e) {
throw new CompletionException(new RestHandlerException(
"Could not upload job files.",
HttpResponseStatus.INTERNAL_SERVER_ERROR,
e));
}
return jobGraph;
});
}
代码示例来源:origin: org.apache.flink/flink-clients_2.11
for (Path jar : jobGraph.getUserJars()) {
jarFileNames.add(jar.getName());
filesToUpload.add(new FileUpload(Paths.get(jar.toUri()), RestConstants.CONTENT_TYPE_JAR));
代码示例来源:origin: org.apache.flink/flink-yarn
for (org.apache.flink.core.fs.Path path : jobGraph.getUserJars()) {
userJarFiles.add(new File(path.toUri()));
代码示例来源:origin: com.alibaba.blink/flink-clients
log.info("Uploading user-jars is disabled");
} else {
for (Path jar : jobGraph.getUserJars()) {
try {
if (!jar.getFileSystem().isDistributedFS()) {
代码示例来源:origin: org.apache.flink/flink-yarn_2.11
for (org.apache.flink.core.fs.Path path : jobGraph.getUserJars()) {
userJarFiles.add(new File(path.toUri()));