hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vvasu...@apache.org
Subject hadoop git commit: HADOOP-12712. Fix some cmake plugin and native build warnings (cmccabe)
Date Thu, 21 Jan 2016 10:37:55 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 ada560bc4 -> de5175d21


HADOOP-12712. Fix some cmake plugin and native build warnings (cmccabe)

(cherry picked from commit b2c155f810888480d058512a326a5083e1bb4eaa)

 Conflicts:
	hadoop-common-project/hadoop-common/CHANGES.txt
	hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
	hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
	hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/util/Exec.java


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/de5175d2
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/de5175d2
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/de5175d2

Branch: refs/heads/branch-2.8
Commit: de5175d2160d87effc06266b70484cd78ca9d675
Parents: ada560b
Author: Colin Patrick Mccabe <cmccabe@cloudera.com>
Authored: Fri Jan 15 12:29:18 2016 -0800
Committer: Varun Vasudev <vvasudev@apache.org>
Committed: Thu Jan 21 16:04:05 2016 +0530

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt |  2 +
 .../org/apache/hadoop/net/unix/DomainSocket.c   |  2 +-
 .../apache/hadoop/maven/plugin/util/Exec.java   | 52 ++++++++++++++++++--
 .../container-executor/impl/configuration.c     |  2 +-
 4 files changed, 53 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/de5175d2/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 7406ee7..edb0063 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -944,6 +944,8 @@ Release 2.8.0 - UNRELEASED
     HADOOP-12356. Fix computing CPU usage statistics on Windows.
     (Inigo Goiri via wangda)
 
+    HADOOP-12712. Fix some cmake plugin and native build warnings (cmccabe)
+
 Release 2.7.3 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/de5175d2/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/net/unix/DomainSocket.c
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/net/unix/DomainSocket.c
b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/net/unix/DomainSocket.c
index 221782d..9ae9f76 100644
--- a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/net/unix/DomainSocket.c
+++ b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/net/unix/DomainSocket.c
@@ -268,7 +268,7 @@ Java_org_apache_hadoop_net_unix_DomainSocket_validateSocketPathSecurity0(
 JNIEnv *env, jclass clazz, jobject jstr, jint skipComponents)
 {
   jint utfLength;
-  char path[PATH_MAX], check[PATH_MAX], *token, *rest, *rest_free;
+  char path[PATH_MAX], check[PATH_MAX], *token, *rest, *rest_free = NULL;
   struct stat st;
   int ret, mode, strlenPath;
   uid_t uid;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/de5175d2/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/util/Exec.java
----------------------------------------------------------------------
diff --git a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/util/Exec.java
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/util/Exec.java
index ce3543c..decfca4 100644
--- a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/util/Exec.java
+++ b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/util/Exec.java
@@ -22,6 +22,7 @@ import java.io.InputStreamReader;
 import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 /**
  * Exec is a helper class for executing an external process from a mojo.
@@ -93,7 +94,7 @@ public class Exec {
    * OutputBufferThread is a background thread for consuming and storing output
    * of the external process.
    */
-  private static class OutputBufferThread extends Thread {
+  public static class OutputBufferThread extends Thread {
     private List<String> output;
     private BufferedReader reader;
 
@@ -126,12 +127,57 @@ public class Exec {
     }
 
     /**
-     * Returns every line consumed from the input.
+     * Get every line consumed from the input.
      * 
-     * @return List<String> every line consumed from the input
+     * @return  Every line consumed from the input
      */
     public List<String> getOutput() {
       return output;
     }
   }
+
+  /**
+   * Add environment variables to a ProcessBuilder.
+   *
+   * @param pb      The ProcessBuilder
+   * @param env     A map of environment variable names to values.
+   */
+  public static void addEnvironment(ProcessBuilder pb,
+        Map<String, String> env) {
+    if (env == null) {
+      return;
+    }
+    Map<String, String> processEnv = pb.environment();
+    for (Map.Entry<String, String> entry : env.entrySet()) {
+      String val = entry.getValue();
+      if (val == null) {
+        val = "";
+      }
+      processEnv.put(entry.getKey(), val);
+    }
+  }
+
+  /**
+   * Pretty-print the environment to a StringBuilder.
+   *
+   * @param env     A map of environment variable names to values to print.
+   *
+   * @return        The pretty-printed string.
+   */
+  public static String envToString(Map<String, String> env) {
+    StringBuilder bld = new StringBuilder();
+    bld.append("{");
+    if (env != null) {
+      for (Map.Entry<String, String> entry : env.entrySet()) {
+        String val = entry.getValue();
+        if (val == null) {
+          val = "";
+        }
+        bld.append("\n  ").append(entry.getKey()).
+              append(" = '").append(val).append("'\n");
+      }
+    }
+    bld.append("}");
+    return bld.toString();
+  }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/de5175d2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/configuration.c
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/configuration.c
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/configuration.c
index 94d81f4..17cce75 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/configuration.c
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/configuration.c
@@ -320,7 +320,7 @@ char ** extract_values_delim(char *value, const char *delim) {
  * Extracts array of values from the '%' separated list of values.
  */
 char ** extract_values(char *value) {
-  extract_values_delim(value, "%");
+  return extract_values_delim(value, "%");
 }
 
 // free an entry set of values


Mime
View raw message