本文整理了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
[英]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);
内容来源于网络,如有侵权,请联系作者删除!