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

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

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

Shell.getQualifiedBinPath介绍

[英]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: com.github.jiayuhan-it/hadoop-common

public static final String getWinUtilsPath() {
 String winUtilsPath = null;
 try {
  if (WINDOWS) {
   winUtilsPath = getQualifiedBinPath("winutils.exe");
  }
 } catch (IOException ioe) {
   LOG.error("Failed to locate the winutils binary in the hadoop binary path",
    ioe);
 }
 return winUtilsPath;
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

public static final String getWinUtilsPath() {
 String winUtilsPath = null;
 try {
  if (WINDOWS) {
   winUtilsPath = getQualifiedBinPath("winutils.exe");
  }
 } catch (IOException ioe) {
   LOG.error("Failed to locate the winutils binary in the hadoop binary path",
    ioe);
 }
 return winUtilsPath;
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

public static final String getWinUtilsPath() {
 String winUtilsPath = null;
 try {
  if (WINDOWS) {
   winUtilsPath = getQualifiedBinPath("winutils.exe");
  }
 } catch (IOException ioe) {
   LOG.error("Failed to locate the winutils binary in the hadoop binary path",
    ioe);
 }
 return winUtilsPath;
}

代码示例来源:origin: cdapio/cdap

public static final String getWinUtilsPath() {
 String winUtilsPath = null;
 try {
  if (WINDOWS) {
   winUtilsPath = getQualifiedBinPath("winutils.exe");
  }
 } catch (IOException ioe) {
   LOG.error("Failed to locate the winutils binary in the hadoop binary path",
    ioe);
 }
 return winUtilsPath;
}

代码示例来源:origin: org.apache.slider/slider-core

/**
 * Check for any needed libraries being present. On Unix none are needed;
 * on windows they must be present
 * @return true if all is well
 */
public static String checkForRequiredNativeLibraries() {
 if (!Shell.WINDOWS) {
  return "";
 }
 StringBuilder errorText = new StringBuilder("");
 if (!NativeIO.isAvailable()) {
  errorText.append("No native IO library. ");
 }
 try {
  String path = Shell.getQualifiedBinPath(WINUTILS);
  log.debug("winutils is at {}", path);
 } catch (IOException e) {
  errorText.append("No " + WINUTILS);
  log.warn("No winutils: {}", e, e);
 }
 try {
  File target = new File("target");
  FileUtil.canRead(target);
 } catch (UnsatisfiedLinkError e) {
  log.warn("Failing to link to native IO methods: {}", e, e);
  errorText.append("No native IO methods");
 }
 return errorText.toString();
}

代码示例来源:origin: apache/incubator-slider

/**
 * Check for any needed libraries being present. On Unix none are needed;
 * on windows they must be present
 * @return true if all is well
 */
public static String checkForRequiredNativeLibraries() {
 if (!Shell.WINDOWS) {
  return "";
 }
 StringBuilder errorText = new StringBuilder("");
 if (!NativeIO.isAvailable()) {
  errorText.append("No native IO library. ");
 }
 try {
  String path = Shell.getQualifiedBinPath(WINUTILS);
  log.debug("winutils is at {}", path);
 } catch (IOException e) {
  errorText.append("No " + WINUTILS);
  log.warn("No winutils: {}", e, e);
 }
 try {
  File target = new File("target");
  FileUtil.canRead(target);
 } catch (UnsatisfiedLinkError e) {
  log.warn("Failing to link to native IO methods: {}", e, e);
  errorText.append("No native IO methods");
 }
 return errorText.toString();
}

相关文章