src/main/java/org/apache/mesos/hdfs/executor/AbstractNodeExecutor.java
/**
   * Add hdfs binary to the PATH environment variable by linking it to /usr/bin/hadoop. This
   * requires that /usr/bin/ is on the Mesos slave PATH, which is defined as part of the standard
   * Mesos slave packaging.
   **/
Add hdfs binary to the PATH environment variable by linking it to /usr/bin/hadoop. This
requires that /usr/bin/ is on the Mesos slave PATH, which is defined as part of the standard
Mesos slave packaging.
Add hdfs binary to the PATH environment variable by linking it to / usr / bin / hadoop . This requires that / usr / bin / is on the Mesos slave PATH which is defined as part of the standard Mesos slave packaging .
private void addBinaryToPath(String hdfsBinaryPath) throws IOException, InterruptedException {
    if (schedulerConf.usingNativeHadoopBinaries())
      return;
    String pathEnvVarLocation = "/usr/bin/hadoop";
    String scriptContent = "#!/bin/bash \n" + hdfsBinaryPath + "/bin/hadoop \"$@\"";
    FileWriter fileWriter = new FileWriter(pathEnvVarLocation);
    BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
    bufferedWriter.write(scriptContent);
    bufferedWriter.close();
    ProcessBuilder processBuilder = new ProcessBuilder("chmod", "a+x", pathEnvVarLocation);
    Process process = processBuilder.start();
    int exitCode = process.waitFor();
    if (exitCode != 0) {
      log.fatal("Error creating the symbolic link to hdfs binary."
          + "Failure running 'chmod a+x " + pathEnvVarLocation + "'");
      System.exit(1);
    }
  }
private void addBinaryToPath ( String hdfsBinaryPath ) throws IOException , InterruptedException { if ( schedulerConf . usingNativeHadoopBinaries ( ) ) return ; String pathEnvVarLocation = "/usr/bin/hadoop" ; String scriptContent = "#!/bin/bash \n" + hdfsBinaryPath + "/bin/hadoop \"$@\"" ; FileWriter fileWriter = new FileWriter ( pathEnvVarLocation ) ; BufferedWriter bufferedWriter = new BufferedWriter ( fileWriter ) ; bufferedWriter . write ( scriptContent ) ; bufferedWriter . close ( ) ; ProcessBuilder processBuilder = new ProcessBuilder ( "chmod" , "a+x" , pathEnvVarLocation ) ; Process process = processBuilder . start ( ) ; int exitCode = process . waitFor ( ) ; if ( exitCode != 0 ) { log . fatal ( "Error creating the symbolic link to hdfs binary." + "Failure running 'chmod a+x " + pathEnvVarLocation + "'" ) ; System . exit ( 1 ) ; } }
Add hdfs binary to the PATH environment variable by linking it to /usr/bin/hadoop.
Add hdfs binary to the PATH environment variable by linking it to / usr / bin / hadoop .