当前位置: 首页>>代码示例>>Java>>正文


Java DFSUtil.getHttpClientScheme方法代码示例

本文整理汇总了Java中org.apache.hadoop.hdfs.DFSUtil.getHttpClientScheme方法的典型用法代码示例。如果您正苦于以下问题:Java DFSUtil.getHttpClientScheme方法的具体用法?Java DFSUtil.getHttpClientScheme怎么用?Java DFSUtil.getHttpClientScheme使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hdfs.DFSUtil的用法示例。


在下文中一共展示了DFSUtil.getHttpClientScheme方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseConfAndFindOtherNN

import org.apache.hadoop.hdfs.DFSUtil; //导入方法依赖的package包/类
private void parseConfAndFindOtherNN() throws IOException {
  Configuration conf = getConf();
  nsId = DFSUtil.getNamenodeNameServiceId(conf);

  if (!HAUtil.isHAEnabled(conf, nsId)) {
    throw new HadoopIllegalArgumentException(
        "HA is not enabled for this namenode.");
  }
  nnId = HAUtil.getNameNodeId(conf, nsId);
  NameNode.initializeGenericKeys(conf, nsId, nnId);

  if (!HAUtil.usesSharedEditsDir(conf)) {
    throw new HadoopIllegalArgumentException(
      "Shared edits storage is not enabled for this namenode.");
  }
  
  Configuration otherNode = HAUtil.getConfForOtherNode(conf);
  otherNNId = HAUtil.getNameNodeId(otherNode, nsId);
  otherIpcAddr = NameNode.getServiceAddress(otherNode, true);
  Preconditions.checkArgument(otherIpcAddr.getPort() != 0 &&
      !otherIpcAddr.getAddress().isAnyLocalAddress(),
      "Could not determine valid IPC address for other NameNode (%s)" +
      ", got: %s", otherNNId, otherIpcAddr);

  final String scheme = DFSUtil.getHttpClientScheme(conf);
  otherHttpAddr = DFSUtil.getInfoServerWithDefaultHost(
      otherIpcAddr.getHostName(), otherNode, scheme).toURL();

  dirsToFormat = FSNamesystem.getNamespaceDirs(conf);
  editUrisToFormat = FSNamesystem.getNamespaceEditsDirs(
      conf, false);
  sharedEditsUris = FSNamesystem.getSharedEditsDirs(conf);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:34,代码来源:BootstrapStandby.java

示例2: getImageListenAddress

import org.apache.hadoop.hdfs.DFSUtil; //导入方法依赖的package包/类
private URL getImageListenAddress() {
  InetSocketAddress httpSocAddr = backupNode.getHttpAddress();
  int httpPort = httpSocAddr.getPort();
  try {
    return new URL(DFSUtil.getHttpClientScheme(conf) + "://" + infoBindAddress + ":" + httpPort);
  } catch (MalformedURLException e) {
    // Unreachable
    throw new RuntimeException(e);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:Checkpointer.java

示例3: getInfoServer

import org.apache.hadoop.hdfs.DFSUtil; //导入方法依赖的package包/类
/**
 * Returns the Jetty server that the Namenode is listening on.
 */
private URL getInfoServer() throws IOException {
  URI fsName = FileSystem.getDefaultUri(conf);
  if (!HdfsConstants.HDFS_URI_SCHEME.equalsIgnoreCase(fsName.getScheme())) {
    throw new IOException("This is not a DFS");
  }

  final String scheme = DFSUtil.getHttpClientScheme(conf);
  URI address = DFSUtil.getInfoServerWithDefaultHost(fsName.getHost(), conf,
      scheme);
  LOG.debug("Will connect to NameNode at " + address);
  return address.toURL();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:SecondaryNameNode.java

示例4: getHttpAddress

import org.apache.hadoop.hdfs.DFSUtil; //导入方法依赖的package包/类
private URL getHttpAddress(Configuration conf) throws IOException {
  final String scheme = DFSUtil.getHttpClientScheme(conf);
  String defaultHost = NameNode.getServiceAddress(conf, true).getHostName();
  URI addr = DFSUtil.getInfoServerWithDefaultHost(defaultHost, conf, scheme);
  return addr.toURL();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:StandbyCheckpointer.java


注:本文中的org.apache.hadoop.hdfs.DFSUtil.getHttpClientScheme方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。