当前位置: 首页>>代码示例>>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;未经允许,请勿转载。