org.apache.hadoop.util.Shell.checkHadoopHomeInner()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(203)

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

Shell.checkHadoopHomeInner介绍

[英]Validate the accessibility of the Hadoop home directory.
[中]验证Hadoop主目录的可访问性。

代码示例

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

/**
 *  Centralized logic to discover and validate the sanity of the Hadoop
 *  home directory.
 *
 *  This does a lot of work so it should only be called
 *  privately for initialization once per process.
 *
 * @return A directory that exists and via was specified on the command line
 * via <code>-Dhadoop.home.dir</code> or the <code>HADOOP_HOME</code>
 * environment variable.
 * @throws FileNotFoundException if the properties are absent or the specified
 * path is not a reference to a valid directory.
 */
private static File checkHadoopHome() throws FileNotFoundException {
 // first check the Dflag hadoop.home.dir with JVM scope
 String home = System.getProperty(SYSPROP_HADOOP_HOME_DIR);
 // fall back to the system/user-global env variable
 if (home == null) {
  home = System.getenv(ENV_HADOOP_HOME);
 }
 return checkHadoopHomeInner(home);
}

代码示例来源:origin: io.hops/hadoop-common

/**
 *  Centralized logic to discover and validate the sanity of the Hadoop
 *  home directory.
 *
 *  This does a lot of work so it should only be called
 *  privately for initialization once per process.
 *
 * @return A directory that exists and via was specified on the command line
 * via <code>-Dhadoop.home.dir</code> or the <code>HADOOP_HOME</code>
 * environment variable.
 * @throws FileNotFoundException if the properties are absent or the specified
 * path is not a reference to a valid directory.
 */
private static File checkHadoopHome() throws FileNotFoundException {
 // first check the Dflag hadoop.home.dir with JVM scope
 String home = System.getProperty(SYSPROP_HADOOP_HOME_DIR);
 // fall back to the system/user-global env variable
 if (home == null) {
  home = System.getenv(ENV_HADOOP_HOME);
 }
 return checkHadoopHomeInner(home);
}

相关文章