public static String getBaseName(LocalResource lr) { return FilenameUtils.getName(lr.getResource().getFile()); }
private static LocalResource createResource(String url) { LocalResource res = mock(LocalResource.class); when(res.getResource()).thenReturn(URL.fromPath(new Path(url))); return res; }
ContainerLaunchContext ctx = Utils.createTaskExecutorContext(flinkConf, yarnConf, env, tmParams, taskManagerConf, workingDirectory, taskManagerMainClass, LOG); assertEquals("file", ctx.getLocalResources().get("flink.jar").getResource().getScheme());
@Private @VisibleForTesting public static URL fromPath(Path path, Configuration conf) { return fromURI(path.toUri(), conf); }
@Public @Deprecated public static URL getYarnUrlFromURI(URI uri) { return URL.fromURI(uri); }
private void makeJarAvailableInSharedCache(Path jar, MyFileUploader fileUploader) throws YarnException, IOException { // copy file to remote file system Path remoteFile = copyToRemote(jar); // prime mocking so that it looks like this file is in the shared cache fileUploader.mockFileInSharedCache(jar, URL.fromPath(remoteFile)); }
public String getBaseName(LocalResource lr) { return FilenameUtils.getName(lr.getResource().getFile()); }
@Private @VisibleForTesting public static URL fromPath(Path path, Configuration conf) { return fromURI(path.toUri(), conf); }
@Public @Stable public Path toPath() throws URISyntaxException { return new Path(new URI(getScheme(), getUserInfo(), getHost(), getPort(), getFile(), null, null)); }