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


Java YarnConfiguration.getSocketAddr方法代碼示例

本文整理匯總了Java中org.apache.hadoop.yarn.conf.YarnConfiguration.getSocketAddr方法的典型用法代碼示例。如果您正苦於以下問題:Java YarnConfiguration.getSocketAddr方法的具體用法?Java YarnConfiguration.getSocketAddr怎麽用?Java YarnConfiguration.getSocketAddr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.hadoop.yarn.conf.YarnConfiguration的用法示例。


在下文中一共展示了YarnConfiguration.getSocketAddr方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getRMAddress

import org.apache.hadoop.yarn.conf.YarnConfiguration; //導入方法依賴的package包/類
@Private
@Override
protected InetSocketAddress getRMAddress(YarnConfiguration conf,
    Class<?> protocol) throws IOException {
  if (protocol == ApplicationClientProtocol.class) {
    return conf.getSocketAddr(YarnConfiguration.RM_ADDRESS,
        YarnConfiguration.DEFAULT_RM_ADDRESS,
        YarnConfiguration.DEFAULT_RM_PORT);
  } else if (protocol == ResourceManagerAdministrationProtocol.class) {
    return conf.getSocketAddr(
        YarnConfiguration.RM_ADMIN_ADDRESS,
        YarnConfiguration.DEFAULT_RM_ADMIN_ADDRESS,
        YarnConfiguration.DEFAULT_RM_ADMIN_PORT);
  } else if (protocol == ApplicationMasterProtocol.class) {
    setAMRMTokenService(conf);
    return conf.getSocketAddr(YarnConfiguration.RM_SCHEDULER_ADDRESS,
        YarnConfiguration.DEFAULT_RM_SCHEDULER_ADDRESS,
        YarnConfiguration.DEFAULT_RM_SCHEDULER_PORT);
  } else {
    String message = "Unsupported protocol found when creating the proxy " +
        "connection to ResourceManager: " +
        ((protocol != null) ? protocol.getClass().getName() : "null");
    LOG.error(message);
    throw new IllegalStateException(message);
  }
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:27,代碼來源:ClientRMProxy.java

示例2: getRMAddress

import org.apache.hadoop.yarn.conf.YarnConfiguration; //導入方法依賴的package包/類
@InterfaceAudience.Private
@Override
protected InetSocketAddress getRMAddress(YarnConfiguration conf,
                                         Class<?> protocol) {
  if (protocol == ResourceTracker.class) {
    return conf.getSocketAddr(
      YarnConfiguration.RM_RESOURCE_TRACKER_ADDRESS,
      YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_ADDRESS,
      YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_PORT);
  } else {
    String message = "Unsupported protocol found when creating the proxy " +
        "connection to ResourceManager: " +
        ((protocol != null) ? protocol.getClass().getName() : "null");
    LOG.error(message);
    throw new IllegalStateException(message);
  }
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:18,代碼來源:ServerRMProxy.java

示例3: buildRedirectPath

import org.apache.hadoop.yarn.conf.YarnConfiguration; //導入方法依賴的package包/類
private String buildRedirectPath() {
  // make a copy of the original configuration so not to mutate it. Also use
  // an YarnConfiguration to force loading of yarn-site.xml.
  YarnConfiguration yarnConf = new YarnConfiguration(rm.getConfig());
  String activeRMHAId = RMHAUtils.findActiveRMHAId(yarnConf);
  String path = "";
  if (activeRMHAId != null) {
    yarnConf.set(YarnConfiguration.RM_HA_ID, activeRMHAId);

    InetSocketAddress sock = YarnConfiguration.useHttps(yarnConf)
        ? yarnConf.getSocketAddr(YarnConfiguration.RM_WEBAPP_HTTPS_ADDRESS,
            YarnConfiguration.DEFAULT_RM_WEBAPP_HTTPS_ADDRESS,
            YarnConfiguration.DEFAULT_RM_WEBAPP_HTTPS_PORT)
        : yarnConf.getSocketAddr(YarnConfiguration.RM_WEBAPP_ADDRESS,
            YarnConfiguration.DEFAULT_RM_WEBAPP_ADDRESS,
            YarnConfiguration.DEFAULT_RM_WEBAPP_PORT);

    path = sock.getHostName() + ":" + Integer.toString(sock.getPort());
    path = YarnConfiguration.useHttps(yarnConf)
        ? "https://" + path
        : "http://" + path;
  }
  return path;
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:25,代碼來源:RMWebApp.java

示例4: RMHAServiceTarget

import org.apache.hadoop.yarn.conf.YarnConfiguration; //導入方法依賴的package包/類
public RMHAServiceTarget(YarnConfiguration conf)
    throws IOException {
  autoFailoverEnabled = HAUtil.isAutomaticFailoverEnabled(conf);
  haAdminServiceAddress = conf.getSocketAddr(
      YarnConfiguration.RM_ADMIN_ADDRESS,
      YarnConfiguration.DEFAULT_RM_ADMIN_ADDRESS,
      YarnConfiguration.DEFAULT_RM_ADMIN_PORT);
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:9,代碼來源:RMHAServiceTarget.java

示例5: createSCMAdminProtocol

import org.apache.hadoop.yarn.conf.YarnConfiguration; //導入方法依賴的package包/類
protected SCMAdminProtocol createSCMAdminProtocol() throws IOException {
  // Get the current configuration
  final YarnConfiguration conf = new YarnConfiguration(getConf());

  // Create the admin client
  final InetSocketAddress addr = conf.getSocketAddr(
      YarnConfiguration.SCM_ADMIN_ADDRESS,
      YarnConfiguration.DEFAULT_SCM_ADMIN_ADDRESS,
      YarnConfiguration.DEFAULT_SCM_ADMIN_PORT);
  final YarnRPC rpc = YarnRPC.create(conf);
  SCMAdminProtocol scmAdminProtocol =
      (SCMAdminProtocol) rpc.getProxy(SCMAdminProtocol.class, addr, conf);
  return scmAdminProtocol;
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:15,代碼來源:SCMAdmin.java


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