}
Path p = new Path(uri);
FileSystem pathfs = p.getFileSystem(conf);
RemoteIterator<LocatedFileStatus> iter = pathfs.listFiles(p, false);
while (iter.hasNext()) {
LocatedFileStatus fStatus = iter.next();
String rsrcName = fStatus.getPath().getName();
// FIXME currently not checking for duplicates due to quirks
// in assembly generation
if (tezJarResources.containsKey(rsrcName)) {
String message = "Duplicate resource found"
+ ", resourceName=" + rsrcName
+ ", existingPath=" +
tezJarResources.get(rsrcName).getResource().toString()
+ ", newPath=" + fStatus.getPath();
LOG.warn(message);
// throw new TezUncheckedException(message);
}
tezJarResources.put(rsrcName,
LocalResource.newInstance(
ConverterUtils.getYarnUrlFromPath(fStatus.getPath()),
LocalResourceType.FILE,
LocalResourceVisibility.PUBLIC,
fStatus.getLen(),
fStatus.getModificationTime()));
}
}
if (tezJarResources.isEmpty()) {
LOG.warn("No tez jars found in configured locations"
+ ". Ignoring for now. Errors may occur");