org.apache.hadoop.hdfs.server.datanode.DataNode.getHostName()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(154)

本文整理了Java中org.apache.hadoop.hdfs.server.datanode.DataNode.getHostName()方法的一些代码示例,展示了DataNode.getHostName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataNode.getHostName()方法的具体详情如下:
包路径:org.apache.hadoop.hdfs.server.datanode.DataNode
类名称:DataNode
方法名:getHostName

DataNode.getHostName介绍

[英]Returns the hostname for this datanode. If the hostname is not explicitly configured in the given config, then it is determined via the DNS class.
[中]返回此数据节点的主机名。如果主机名未在给定配置中明确配置,则通过DNS类确定。

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-hdfs

hostName = getHostName(conf);
LOG.info("Configured hostname is {}", hostName);
startDataNode(dataDirs, resources);

代码示例来源:origin: org.apache.hadoop/hadoop-hdfs

/** Instantiate a single datanode object, along with its secure resources. 
 * This must be run by invoking{@link DataNode#runDatanodeDaemon()} 
 * subsequently. 
 */
public static DataNode instantiateDataNode(String args [], Configuration conf,
  SecureResources resources) throws IOException {
 if (conf == null)
  conf = new HdfsConfiguration();
 
 if (args != null) {
  // parse generic hadoop options
  GenericOptionsParser hParser = new GenericOptionsParser(conf, args);
  args = hParser.getRemainingArgs();
 }
 
 if (!parseArguments(args, conf)) {
  printUsage(System.err);
  return null;
 }
 Collection<StorageLocation> dataLocations = getStorageLocations(conf);
 UserGroupInformation.setConfiguration(conf);
 SecurityUtil.login(conf, DFS_DATANODE_KEYTAB_FILE_KEY,
   DFS_DATANODE_KERBEROS_PRINCIPAL_KEY, getHostName(conf));
 return makeInstance(dataLocations, conf, resources);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-hdfs

hostName = getHostName(conf);
LOG.info("Configured hostname is " + hostName);
startDataNode(conf, dataDirs, resources);

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

hostName = getHostName(conf);
LOG.info("Configured hostname is " + hostName);
startDataNode(conf, dataDirs, resources);

相关文章

DataNode类方法