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

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

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

Shell.addOsText介绍

[英]Optionally extend an error message with some OS-specific text.
[中]可以选择使用一些特定于操作系统的文本来扩展错误消息。

代码示例

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

/**
 * Get the Hadoop home directory. If it is invalid,
 * throw an exception.
 * @return a path referring to hadoop home.
 * @throws FileNotFoundException if the directory doesn't exist.
 */
private static File getHadoopHomeDir() throws FileNotFoundException {
 if (HADOOP_HOME_DIR_FAILURE_CAUSE != null) {
  throw fileNotFoundException(
    addOsText(HADOOP_HOME_DIR_FAILURE_CAUSE.toString()),
    HADOOP_HOME_DIR_FAILURE_CAUSE);
 }
 return HADOOP_HOME_FILE;
}

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

File bin = new File(hadoopHomeDir, "bin");
if (!bin.exists()) {
 throw new FileNotFoundException(addOsText(binDirText + E_DOES_NOT_EXIST
   + ": " + bin));
 throw new FileNotFoundException(addOsText(binDirText + E_NOT_DIRECTORY
   + ": " + bin));
if (!exeFile.exists()) {
 throw new FileNotFoundException(
   addOsText(E_NO_EXECUTABLE + ": " + exeFile));
   addOsText(E_NOT_EXECUTABLE_FILE + ": " + exeFile));

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

/**
 * Get the Hadoop home directory. If it is invalid,
 * throw an exception.
 * @return a path referring to hadoop home.
 * @throws FileNotFoundException if the directory doesn't exist.
 */
private static File getHadoopHomeDir() throws FileNotFoundException {
 if (HADOOP_HOME_DIR_FAILURE_CAUSE != null) {
  throw fileNotFoundException(
    addOsText(HADOOP_HOME_DIR_FAILURE_CAUSE.toString()),
    HADOOP_HOME_DIR_FAILURE_CAUSE);
 }
 return HADOOP_HOME_FILE;
}

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

File bin = new File(hadoopHomeDir, "bin");
if (!bin.exists()) {
 throw new FileNotFoundException(addOsText(binDirText + E_DOES_NOT_EXIST
   + ": " + bin));
 throw new FileNotFoundException(addOsText(binDirText + E_NOT_DIRECTORY
   + ": " + bin));
if (!exeFile.exists()) {
 throw new FileNotFoundException(
   addOsText(E_NO_EXECUTABLE + ": " + exeFile));
   addOsText(E_NOT_EXECUTABLE_FILE + ": " + exeFile));

相关文章

微信公众号

最新文章

更多