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

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

本文整理了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

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

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

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

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

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

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

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

相关文章