本文整理匯總了Java中org.apache.hadoop.yarn.api.records.LocalResourceVisibility.valueOf方法的典型用法代碼示例。如果您正苦於以下問題:Java LocalResourceVisibility.valueOf方法的具體用法?Java LocalResourceVisibility.valueOf怎麽用?Java LocalResourceVisibility.valueOf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.hadoop.yarn.api.records.LocalResourceVisibility
的用法示例。
在下文中一共展示了LocalResourceVisibility.valueOf方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: main
import org.apache.hadoop.yarn.api.records.LocalResourceVisibility; //導入方法依賴的package包/類
public static void main(String[] args) throws UnsupportedEncodingException {
// It should get at least one file to localize
if (args == null || args.length < 6) {
LOG.info("There are no files to localize.");
System.exit(0);
}
LOG.info("Container localization process started.");
// arg[0] - localization directory
String localizationDir = args[0];
try {
// arg[1] - No of localization threads
int localizeThreads = Integer.parseInt(args[1].trim());
Collection<LocalizationResource> resources = new ArrayList<LocalizationResource>();
for (int i = 2; i < args.length; i = i + 5) {
// args[i] - localization resource
// args[i+1] - resource target name
// args[i+2] - visibility
// args[i+3] - resource type
// args[i+4] - pattern
LocalizationResource resource = new LocalizationResource(args[i],
args[i + 1], LocalResourceVisibility.valueOf(args[i + 2]),
args[i + 3], URLDecoder.decode(args[i + 4],
HPCConfiguration.CHAR_ENCODING));
resources.add(resource);
}
LocalizationService service = new LocalizationService(localizationDir,
localizeThreads, resources);
service.localizeFiles();
LOG.info("Container localization process completed.");
} catch (Throwable e) {
LOG.error("Exception occured during container localization process.", e);
}
}
示例2: convertFromProtoFormat
import org.apache.hadoop.yarn.api.records.LocalResourceVisibility; //導入方法依賴的package包/類
public static LocalResourceVisibility convertFromProtoFormat(LocalResourceVisibilityProto e) {
return LocalResourceVisibility.valueOf(e.name());
}