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

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

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

Shell.getQualifiedBin介绍

[英]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.
[中]完全限定应该位于已知hadoop bin位置的二进制文件的路径。这主要用于消除对Hadoop可执行子组件的调用的歧义,以避免与路径中的其他可执行文件发生冲突。警告:这个调用不仅仅格式化bin目录的路径。它还检查组合路径的文件是否存在。调用方应缓存此调用的输出。

代码示例

代码示例来源: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
 * @throws IOException on path canonicalization failures
 */
public static String getQualifiedBinPath(String executable)
  throws IOException {
 return getQualifiedBin(executable).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
 * @throws IOException on path canonicalization failures
 */
public static String getQualifiedBinPath(String executable)
  throws IOException {
 return getQualifiedBin(executable).getCanonicalPath();
}

相关文章

微信公众号

最新文章

更多