src/main/java/org/apache/mesos/hdfs/executor/AbstractNodeExecutor.java
/**
   * Reloads the cluster configuration so the executor has the correct configuration info.
   **/
Reloads the cluster configuration so the executor has the correct configuration info.
Reloads the cluster configuration so the executor has the correct configuration info .
protected void reloadConfig() {
    if (schedulerConf.usingNativeHadoopBinaries()) return;
    String configUri = "";
    for (CommandInfo.URI uri : executorInfo.getCommand().getUrisList()) {
      if (uri.getValue().contains("hdfs-site.xml")) {
        configUri = uri.getValue();
      }
    }
    if (configUri.isEmpty()) {
      log.error("Couldn't find hdfs-site.xml URI");
      return;
    }
    try {
      log.info(String.format("Reloading hdfs-site.xml from %s", configUri));
      ProcessBuilder processBuilder = new ProcessBuilder("sh", "-c",
          String.format("curl -o hdfs-site.xml %s && cp hdfs-site.xml etc/hadoop/", configUri));
      Process process = processBuilder.start();
      redirectProcess(process);
      int exitCode = process.waitFor();
      if (exitCode == 0) {
        log.info("Finished reloading hdfs-site.xml, exited with status " + exitCode);
      } else {
        log.error("Error reloading hdfs-site.xml.");
      }
    } catch (InterruptedException | IOException e) {
      log.error("Caught exception", e);
    }
  }
protected void reloadConfig ( ) { if ( schedulerConf . usingNativeHadoopBinaries ( ) ) return ; String configUri = "" ; for ( CommandInfo . URI uri : executorInfo . getCommand ( ) . getUrisList ( ) ) { if ( uri . getValue ( ) . contains ( "hdfs-site.xml" ) ) { configUri = uri . getValue ( ) ; } } if ( configUri . isEmpty ( ) ) { log . error ( "Couldn't find hdfs-site.xml URI" ) ; return ; } try { log . info ( String . format ( "Reloading hdfs-site.xml from %s" , configUri ) ) ; ProcessBuilder processBuilder = new ProcessBuilder ( "sh" , "-c" , String . format ( "curl -o hdfs-site.xml %s && cp hdfs-site.xml etc/hadoop/" , configUri ) ) ; Process process = processBuilder . start ( ) ; redirectProcess ( process ) ; int exitCode = process . waitFor ( ) ; if ( exitCode == 0 ) { log . info ( "Finished reloading hdfs-site.xml, exited with status " + exitCode ) ; } else { log . error ( "Error reloading hdfs-site.xml." ) ; } } catch ( InterruptedException | IOException e ) { log . error ( "Caught exception" , e ) ; } }
Reloads the cluster configuration so the executor has the correct configuration info.
Reloads the cluster configuration so the executor has the correct configuration info .
// Find config URI //TODO(nicgrayson) check if the config has changed