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

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

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

Shell.getWinUtilsFile介绍

[英]Get a file reference to winutils. Always raises an exception if there isn't one
[中]获取对winutils的文件引用。如果没有异常,总是引发异常

代码示例

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

@Override
 String[] linkCount(File file) throws IOException {
  // trigger the check for winutils
  Shell.getWinUtilsFile();
  String[] buf = new String[getLinkCountCommand.length];
  System.arraycopy(getLinkCountCommand, 0, buf, 0, 
           getLinkCountCommand.length);
  buf[getLinkCountCommand.length - 1] = file.getCanonicalPath();
  return buf;
 }
}

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

String getSystemInfoInfoFromShell() {
 try {
  ShellCommandExecutor shellExecutor = new ShellCommandExecutor(
    new String[] {Shell.getWinUtilsFile().getCanonicalPath(),
      "systeminfo" });
  shellExecutor.execute();
  return shellExecutor.getOutput();
 } catch (IOException e) {
  LOG.error(StringUtils.stringifyException(e));
 }
 return null;
}

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

winutilsPath = Shell.getWinUtilsFile().getCanonicalPath();
 winutilsExists = true;
} catch (IOException e) {

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

@Override
 String[] linkCount(File file) throws IOException {
  // trigger the check for winutils
  Shell.getWinUtilsFile();
  String[] buf = new String[getLinkCountCommand.length];
  System.arraycopy(getLinkCountCommand, 0, buf, 0, 
           getLinkCountCommand.length);
  buf[getLinkCountCommand.length - 1] = file.getCanonicalPath();
  return buf;
 }
}

代码示例来源:origin: com.github.cormoran-io.pepper/pepper-parquet

/**
   * 
   * @return true if we already have the property env "hadoop.home.dir", or we succeed finding a good value for it
   */
  public static boolean isHadoopReady() {
    if (Shell.WINDOWS) {
      try {
        if (Shell.getWinUtilsFile().isFile()) {
          return true;
        }
      } catch (FileNotFoundException e) {
        // https://wiki.apache.org/hadoop/WindowsProblems
        LOGGER.trace("Wintutils seems to be missing", e);
      }
    }

    // If we get here, it means winutils is missing
    LOGGER.error(
        "Haddop winutils seems not installed. They can be checked-out from 'git clone https://github.com/steveloughran/winutils.git'");
    return false;
  }
}

代码示例来源:origin: com.github.blasd.apex/apex-parquet

/**
   * 
   * @return true if we already have the property env "hadoop.home.dir", or we succeed finding a good value for it
   */
  public static boolean isHadoopReady() {
    if (Shell.WINDOWS) {
      try {
        if (Shell.getWinUtilsFile().isFile()) {
          return true;
        }
      } catch (FileNotFoundException e) {
        // https://wiki.apache.org/hadoop/WindowsProblems
        LOGGER.trace("Wintutils seems to be missing", e);
      }
    }

    // If we get here, it means winutils is missing
    LOGGER.error(
        "Haddop winutils seems not installed. They can be checked-out from 'git clone https://github.com/steveloughran/winutils.git'");
    return false;
  }
}

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

String getAllProcessInfoFromShell() {
 try {
  ShellCommandExecutor shellExecutor = new ShellCommandExecutor(
    new String[] {Shell.getWinUtilsFile().getCanonicalPath(),
      "task", "processList", taskProcessId });
  shellExecutor.execute();
  return shellExecutor.getOutput();
 } catch (IOException e) {
  LOG.error(StringUtils.stringifyException(e));
 }
 return null;
}

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

String getSystemInfoInfoFromShell() {
 try {
  ShellCommandExecutor shellExecutor = new ShellCommandExecutor(
    new String[] {Shell.getWinUtilsFile().getCanonicalPath(),
      "systeminfo" });
  shellExecutor.execute();
  return shellExecutor.getOutput();
 } catch (IOException e) {
  LOG.error(StringUtils.stringifyException(e));
 }
 return null;
}

相关文章

微信公众号

最新文章

更多