热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.flink.runtime.jobgraph.JobGraph.getUserArtifacts()方法的使用及代码示例

本文整理了Java中org.apache.flink.runtime.jobgraph.JobGraph.getUserArtifacts()方法的一些代码示例,展示了

本文整理了Java中org.apache.flink.runtime.jobgraph.JobGraph.getUserArtifacts()方法的一些代码示例,展示了JobGraph.getUserArtifacts()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JobGraph.getUserArtifacts()方法的具体详情如下:
包路径:org.apache.flink.runtime.jobgraph.JobGraph
类名称:JobGraph
方法名:getUserArtifacts

JobGraph.getUserArtifacts介绍

[英]Gets the list of assigned user jar paths.
[中]获取分配的用户jar路径的列表。

代码示例

代码示例来源:origin: apache/flink

for (Map.Entry artifacts : jobGraph.getUserArtifacts().entrySet()) {
artifactFileNames.add(new JobSubmitRequestBody.DistributedCacheFile(artifacts.getKey(), new Path(artifacts.getValue().filePath).getName()));
filesToUpload.add(new FileUpload(Paths.get(artifacts.getValue().filePath), RestConstants.CONTENT_TYPE_BINARY));

代码示例来源:origin: apache/flink

@Test
public void testArtifactCompression() throws IOException {
Path plainFile1 = tmp.newFile("plainFile1").toPath();
Path plainFile2 = tmp.newFile("plainFile2").toPath();
Path directory1 = tmp.newFolder("directory1").toPath();
Files.createDirectory(directory1.resolve("containedFile1"));
Path directory2 = tmp.newFolder("directory2").toPath();
Files.createDirectory(directory2.resolve("containedFile2"));
JobGraph jb = new JobGraph();
final String executableFileName = "executableFile";
final String nOnExecutableFileName= "nonExecutableFile";
final String executableDirName = "executableDir";
final String nOnExecutableDirName= "nonExecutableDIr";
Collection> originalArtifacts = Arrays.asList(
Tuple2.of(executableFileName, new DistributedCache.DistributedCacheEntry(plainFile1.toString(), true)),
Tuple2.of(nonExecutableFileName, new DistributedCache.DistributedCacheEntry(plainFile2.toString(), false)),
Tuple2.of(executableDirName, new DistributedCache.DistributedCacheEntry(directory1.toString(), true)),
Tuple2.of(nonExecutableDirName, new DistributedCache.DistributedCacheEntry(directory2.toString(), false))
);
JobGraphGenerator.addUserArtifactEntries(originalArtifacts, jb);
Map submittedArtifacts = jb.getUserArtifacts();
DistributedCache.DistributedCacheEntry executableFileEntry = submittedArtifacts.get(executableFileName);
assertState(executableFileEntry, true, false);
DistributedCache.DistributedCacheEntry nOnExecutableFileEntry= submittedArtifacts.get(nonExecutableFileName);
assertState(nonExecutableFileEntry, false, false);
DistributedCache.DistributedCacheEntry executableDirEntry = submittedArtifacts.get(executableDirName);
assertState(executableDirEntry, true, true);
DistributedCache.DistributedCacheEntry nOnExecutableDirEntry= submittedArtifacts.get(nonExecutableDirName);
assertState(nonExecutableDirEntry, false, true);
}

代码示例来源: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: org.apache.flink/flink-clients_2.11

for (Map.Entry artifacts : jobGraph.getUserArtifacts().entrySet()) {
artifactFileNames.add(new JobSubmitRequestBody.DistributedCacheFile(artifacts.getKey(), new Path(artifacts.getValue().filePath).getName()));
filesToUpload.add(new FileUpload(Paths.get(artifacts.getValue().filePath), RestConstants.CONTENT_TYPE_BINARY));

代码示例来源:origin: com.alibaba.blink/flink-runtime

if (executiOnMode== ExecutionMode.DETACHED && jobGraph.getUserArtifacts() != null) {
final InetSocketAddress address = new InetSocketAddress(blobServer.getPort());
List> userArtifacts = new ArrayList<>();
for (Map.Entry entry : jobGraph.getUserArtifacts().entrySet()) {
if (!new Path(entry.getValue().filePath).getFileSystem().isDistributedFS()) {
userArtifacts.add(new Tuple2<>(entry.getKey(), new Path(entry.getKey())));

代码示例来源:origin: com.alibaba.blink/flink-clients

for (Map.Entry artifacts : jobGraph.getUserArtifacts().entrySet()) {
try {
Path file = new Path(artifacts.getValue().filePath);

推荐阅读
author-avatar
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有