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

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

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

Shell.getHadoopHomeDir介绍

[英]Get the Hadoop home directory. If it is invalid, throw an exception.
[中]获取Hadoop主目录。如果无效,则抛出异常。

代码示例

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

/**
 * Get the Hadoop home directory. Raises an exception if not found
 * @return the home dir
 * @throws IOException if the home directory cannot be located.
 */
public static String getHadoopHome() throws IOException {
 return getHadoopHomeDir().getCanonicalPath();
}

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

/**
 *  Fully qualify the path to a binary that should be in a known hadoop
 *  bin location. This is primarily useful for disambiguating call-outs
 *  to executable sub-components of Hadoop to avoid clashes with other
 *  executables that may be in the path.  Caveat:  this call doesn't
 *  just format the path to the bin directory.  It also checks for file
 *  existence of the composed path. The output of this call should be
 *  cached by callers.
 *
 * @param executable executable
 * @return executable file reference
 * @throws FileNotFoundException if the path does not exist
 */
public static File getQualifiedBin(String executable)
  throws FileNotFoundException {
 // construct hadoop bin path to the specified executable
 return getQualifiedBinInner(getHadoopHomeDir(), executable);
}

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

/**
 * Get the Hadoop home directory. Raises an exception if not found
 * @return the home dir
 * @throws IOException if the home directory cannot be located.
 */
public static String getHadoopHome() throws IOException {
 return getHadoopHomeDir().getCanonicalPath();
}

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

/**
 *  Fully qualify the path to a binary that should be in a known hadoop
 *  bin location. This is primarily useful for disambiguating call-outs
 *  to executable sub-components of Hadoop to avoid clashes with other
 *  executables that may be in the path.  Caveat:  this call doesn't
 *  just format the path to the bin directory.  It also checks for file
 *  existence of the composed path. The output of this call should be
 *  cached by callers.
 *
 * @param executable executable
 * @return executable file reference
 * @throws FileNotFoundException if the path does not exist
 */
public static File getQualifiedBin(String executable)
  throws FileNotFoundException {
 // construct hadoop bin path to the specified executable
 return getQualifiedBinInner(getHadoopHomeDir(), executable);
}

相关文章