List of usage examples for org.apache.hadoop.yarn.api.records LocalResourceVisibility APPLICATION
LocalResourceVisibility APPLICATION
To view the source code for org.apache.hadoop.yarn.api.records LocalResourceVisibility APPLICATION.
Click Source Link
From source file:yarnkit.utils.YarnUtils.java
License:Apache License
@Nonnull public static LocalResource createLocalResource(@Nonnull FileSystem fs, @Nonnull Path hdfsPath) throws IOException { LocalResource resource = Records.newRecord(LocalResource.class); FileStatus fileStat = fs.getFileStatus(hdfsPath); resource.setResource(ConverterUtils.getYarnUrlFromPath(hdfsPath)); resource.setSize(fileStat.getLen()); resource.setTimestamp(fileStat.getModificationTime()); resource.setType(fileStat.isFile() ? LocalResourceType.FILE : LocalResourceType.ARCHIVE); resource.setVisibility(LocalResourceVisibility.APPLICATION); return resource; }