Java Code Examples for org.apache.flink.runtime.jobgraph.JobGraph#getUserJarBlobKeys()
The following examples show how to use
org.apache.flink.runtime.jobgraph.JobGraph#getUserJarBlobKeys() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClientUtilsTest.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
@Test public void uploadAndSetUserJars() throws Exception { java.nio.file.Path tmpDir = temporaryFolder.newFolder().toPath(); JobGraph jobGraph = new JobGraph(); Collection<Path> jars = Arrays.asList( new Path(Files.createFile(tmpDir.resolve("jar1.jar")).toString()), new Path(Files.createFile(tmpDir.resolve("jar2.jar")).toString())); jars.forEach(jobGraph::addJar); assertEquals(jars.size(), jobGraph.getUserJars().size()); assertEquals(0, jobGraph.getUserJarBlobKeys().size()); ClientUtils.extractAndUploadJobGraphFiles(jobGraph, () -> new BlobClient(new InetSocketAddress("localhost", blobServer.getPort()), new Configuration())); assertEquals(jars.size(), jobGraph.getUserJars().size()); assertEquals(jars.size(), jobGraph.getUserJarBlobKeys().size()); assertEquals(jars.size(), jobGraph.getUserJarBlobKeys().stream().distinct().count()); for (PermanentBlobKey blobKey : jobGraph.getUserJarBlobKeys()) { blobServer.getFile(jobGraph.getJobID(), blobKey); } }
Example 2
Source File: ClientUtilsTest.java From flink with Apache License 2.0 | 6 votes |
@Test public void uploadAndSetUserJars() throws Exception { java.nio.file.Path tmpDir = temporaryFolder.newFolder().toPath(); JobGraph jobGraph = new JobGraph(); Collection<Path> jars = Arrays.asList( new Path(Files.createFile(tmpDir.resolve("jar1.jar")).toString()), new Path(Files.createFile(tmpDir.resolve("jar2.jar")).toString())); jars.forEach(jobGraph::addJar); assertEquals(jars.size(), jobGraph.getUserJars().size()); assertEquals(0, jobGraph.getUserJarBlobKeys().size()); ClientUtils.extractAndUploadJobGraphFiles(jobGraph, () -> new BlobClient(new InetSocketAddress("localhost", blobServer.getPort()), new Configuration())); assertEquals(jars.size(), jobGraph.getUserJars().size()); assertEquals(jars.size(), jobGraph.getUserJarBlobKeys().size()); assertEquals(jars.size(), jobGraph.getUserJarBlobKeys().stream().distinct().count()); for (PermanentBlobKey blobKey : jobGraph.getUserJarBlobKeys()) { blobServer.getFile(jobGraph.getJobID(), blobKey); } }
Example 3
Source File: ClientUtilsTest.java From flink with Apache License 2.0 | 6 votes |
@Test public void uploadAndSetUserJars() throws Exception { java.nio.file.Path tmpDir = temporaryFolder.newFolder().toPath(); JobGraph jobGraph = new JobGraph(); Collection<Path> jars = Arrays.asList( new Path(Files.createFile(tmpDir.resolve("jar1.jar")).toString()), new Path(Files.createFile(tmpDir.resolve("jar2.jar")).toString())); jars.forEach(jobGraph::addJar); assertEquals(jars.size(), jobGraph.getUserJars().size()); assertEquals(0, jobGraph.getUserJarBlobKeys().size()); ClientUtils.extractAndUploadJobGraphFiles(jobGraph, () -> new BlobClient(new InetSocketAddress("localhost", blobServer.getPort()), new Configuration())); assertEquals(jars.size(), jobGraph.getUserJars().size()); assertEquals(jars.size(), jobGraph.getUserJarBlobKeys().size()); assertEquals(jars.size(), jobGraph.getUserJarBlobKeys().stream().distinct().count()); for (PermanentBlobKey blobKey : jobGraph.getUserJarBlobKeys()) { blobServer.getFile(jobGraph.getJobID(), blobKey); } }