@Public @Deprecated public static URL getYarnUrlFromURI(URI uri) { return URL.fromURI(uri); }
@Private @VisibleForTesting public static URL fromPath(Path path, Configuration conf) { return fromURI(path.toUri(), conf); }
@Private @VisibleForTesting public static URL fromPath(Path path, Configuration conf) { return fromURI(path.toUri(), conf); }
public static LocalResource newLocalResource(URI uri, LocalResourceType type, LocalResourceVisibility visibility, long size, long timestamp, boolean shouldBeUploadedToSharedCache) { return newLocalResource(URL.fromURI(uri), type, visibility, size, timestamp, shouldBeUploadedToSharedCache); }
@Public @Stable public static URL fromPath(Path path) { return fromURI(path.toUri()); } }
@Public @Stable public static URL fromPath(Path path) { return fromURI(path.toUri()); } }
@Public @Stable public static URL fromURI(URI uri) { return fromURI(uri, null); }
@Public @Stable public static URL fromURI(URI uri) { return fromURI(uri, null); }
e); URL resourceURL = URL.fromURI(uriWithFragment); long resourceSize = fstat.getLen(); long resourceModificationTime = fstat.getModificationTime();
private void addToLocalResources(FileSystem fs, String fileSrcPath, String fileDstPath, String appId, Map<String, LocalResource> localResources, String resources) throws IOException { String suffix = appName + "/" + appId + "/" + fileDstPath; Path dst = new Path(fs.getHomeDirectory(), suffix); if (fileSrcPath == null) { FSDataOutputStream ostream = null; try { ostream = FileSystem .create(fs, dst, new FsPermission((short) 0710)); ostream.writeUTF(resources); } finally { IOUtils.closeQuietly(ostream); } } else { fs.copyFromLocalFile(new Path(fileSrcPath), dst); } FileStatus scFileStatus = fs.getFileStatus(dst); LocalResource scRsrc = LocalResource.newInstance( URL.fromURI(dst.toUri()), LocalResourceType.FILE, LocalResourceVisibility.APPLICATION, scFileStatus.getLen(), scFileStatus.getModificationTime()); localResources.put(fileDstPath, scRsrc); }
if(orig != null && !orig.getResource().equals(URL.fromURI(p.toUri()))) { LOG.warn(getResourceDescription(orig.getType()) + orig.getResource() + " conflicts with " + getResourceDescription(type) + u); sharedCachePolicy = sharedCachePolicy == null ? Boolean.FALSE : sharedCachePolicy; localResources.put(linkName, LocalResource.newInstance(URL.fromURI(p .toUri()), type, visibilities[i] ? LocalResourceVisibility.PUBLIC : LocalResourceVisibility.PRIVATE,
yarnUrl = URL.fromURI(new URI(renamedScriptPath.toString())); } catch (URISyntaxException e) { LOG.error("Error when trying to use shell script path specified"
e); rsrc.setResource(URL.fromURI(uriWithFragment)); rsrc.setSize(rsrcStat.getLen()); rsrc.setTimestamp(rsrcStat.getModificationTime());
URL.fromURI(src.toUri()), srcType, LocalResourceVisibility.PRIVATE, scFileStatus.getLen(), scFileStatus.getModificationTime());
.getContainerLaunchContextInfo().getResources().entrySet()) { LocalResourceInfo l = entry.getValue(); LocalResource lr = LocalResource.newInstance(URL.fromURI(l.getUrl()), l.getType(), l.getVisibility(), l.getSize(), l.getTimestamp()); hlr.put(entry.getKey(), lr);
assertTrue(appLRs.containsKey(lrKey)); LocalResource exampleLR = appLRs.get(lrKey); assertEquals(URL.fromURI(y.getUrl()), exampleLR.getResource()); assertEquals(y.getSize(), exampleLR.getSize()); assertEquals(y.getTimestamp(), exampleLR.getTimestamp());