.getPathFromYarnURL(localResources.get(srcPath.getName() + "/1").getResource()) .getParent();
public static String convertToDAGPlan(URL resource) { Path p; try { p = ConverterUtils.getPathFromYarnURL(resource); } catch (URISyntaxException e) { throw new TezUncheckedException("Unable to translate resource: " + resource + " to Path"); } String urlString = p.toString(); return urlString; }
remotePath = ConverterUtils.getPathFromYarnURL(resource.getResource()); } catch (URISyntaxException e) { throw new IOException("Invalid resource", e);
remotePath = ConverterUtils.getPathFromYarnURL(resource.getResource()); } catch (URISyntaxException e) { throw new IOException("Invalid resource", e);
Path destPath = ConverterUtils.getPathFromYarnURL(resource.getValue(). getResource()); URI sparkUri = destPath.toUri();
ConverterUtils.getPathFromYarnURL(resource.getResource()); Path commonResourcePath = ConverterUtils.getPathFromYarnURL( commonLr.getResource());
resourcePath = ConverterUtils.getPathFromYarnURL(resource.getResource()); } catch (URISyntaxException e) { throw new IOException(e);
resourcePath = ConverterUtils.getPathFromYarnURL(resource.getResource()); } catch (URISyntaxException e) { throw new IOException(e);
StringBuilder types = new StringBuilder(); for (Entry<String, LocalResource> entry : localResources.entrySet()) { Path destPath = ConverterUtils.getPathFromYarnURL(entry.getValue(). getResource()); URI sparkUri = destPath.toUri();
final Path sCopy; try { sCopy = ConverterUtils.getPathFromYarnURL(resource.getResource()); } catch (URISyntaxException e) { throw new IOException("Invalid resource", e);
final Path sCopy; try { sCopy = ConverterUtils.getPathFromYarnURL(resource.getResource()); } catch (URISyntaxException e) { throw new IOException("Invalid resource", e);
/** * Wrap API resource to match against cache of localized resources. * @param resource Resource requested by container * @throws URISyntaxException If the path is malformed */ public LocalResourceRequest(LocalResource resource) throws URISyntaxException { this(ConverterUtils.getPathFromYarnURL(resource.getResource()), resource.getTimestamp(), resource.getType(), resource.getVisibility(), resource.getPattern()); }
LOG.info("PackageURL has been composed to " + packageUrl.toString()); LOG.info("Reverting packageURL to path: " + ConverterUtils.getPathFromYarnURL(packageUrl)); } catch (URISyntaxException e) { LOG.fatal("If you see this error the workarround does not work", e);
/** * Wrap API resource to match against cache of localized resources. * @param resource Resource requested by container * @throws URISyntaxException If the path is malformed */ public LocalResourceRequest(LocalResource resource) throws URISyntaxException { this(ConverterUtils.getPathFromYarnURL(resource.getResource()), resource.getTimestamp(), resource.getType(), resource.getVisibility(), resource.getPattern()); }
@Test public void testConvertUrlWithNoPort() throws URISyntaxException { Path expectedPath = new Path("hdfs://foo.com"); URL url = ConverterUtils.getYarnUrlFromPath(expectedPath); Path actualPath = ConverterUtils.getPathFromYarnURL(url); assertEquals(expectedPath, actualPath); }
@Test public void testConvertUrlWithUserinfo() throws URISyntaxException { Path expectedPath = new Path("foo://username:password@example.com:8042"); URL url = ConverterUtils.getYarnUrlFromPath(expectedPath); Path actualPath = ConverterUtils.getPathFromYarnURL(url); assertEquals(expectedPath, actualPath); }
for (Vertex v: dag.getVertices()) { for (LocalResource lr: v.getTaskLocalFiles().values()) { lrPaths.add(ConverterUtils.getPathFromYarnURL(lr.getResource())); lrPaths.add(ConverterUtils.getPathFromYarnURL(lr.getResource()));
public void testCreateLocalResourceForConfigurationFile() throws Exception { HadoopAccessorService has = Services.get().get(HadoopAccessorService.class); String filename = "foo.xml"; Configuration conf = has.createConfiguration(getNameNodeUri()); conf.set("foo", "bar"); LocalResource lRes = has.createLocalResourceForConfigurationFile(filename, getTestUser(), conf, getFileSystem().getUri(), getFsTestCaseDir()); assertNotNull(lRes); assertEquals(LocalResourceType.FILE, lRes.getType()); assertEquals(LocalResourceVisibility.APPLICATION, lRes.getVisibility()); Path resPath = ConverterUtils.getPathFromYarnURL(lRes.getResource()); assertEquals(new Path(getFsTestCaseDir(), "foo.xml"), resPath); Configuration conf2 = new Configuration(false); conf2.addResource(getFileSystem().open(resPath)); assertEquals("bar", conf2.get("foo")); } }
.handle( new ResourceLocalizedEvent(req, ConverterUtils .getPathFromYarnURL(stat.getLocalPath()), stat.getLocalSize())); } catch (URISyntaxException e) { }
.getPathFromYarnURL(stat.getLocalPath()), stat.getLocalSize())); } catch (URISyntaxException e) { }