當前位置: 首頁>>代碼示例>>Java>>正文


Java LocalResourceVisibility.valueOf方法代碼示例

本文整理匯總了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);
  }
}
 
開發者ID:intel-hpdd,項目名稱:scheduling-connector-for-hadoop,代碼行數:34,代碼來源:AppLocalizer.java

示例2: convertFromProtoFormat

import org.apache.hadoop.yarn.api.records.LocalResourceVisibility; //導入方法依賴的package包/類
public static LocalResourceVisibility convertFromProtoFormat(LocalResourceVisibilityProto e) {
  return LocalResourceVisibility.valueOf(e.name());
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:4,代碼來源:ProtoUtils.java


注:本文中的org.apache.hadoop.yarn.api.records.LocalResourceVisibility.valueOf方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。