hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [40/43] hadoop git commit: HADOOP-12712. Fix some cmake plugin and native build warnings (cmccabe)
Date Sat, 16 Jan 2016 00:11:06 GMT
HADOOP-12712. Fix some cmake plugin and native build warnings (cmccabe)


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

Branch: refs/heads/HDFS-1312
Commit: b2c155f810888480d058512a326a5083e1bb4eaa
Parents: 5d5a22a
Author: Colin Patrick Mccabe <cmccabe@cloudera.com>
Authored: Fri Jan 15 12:29:18 2016 -0800
Committer: Colin Patrick Mccabe <cmccabe@cloudera.com>
Committed: Fri Jan 15 12:29:18 2016 -0800

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt    |  2 ++
 .../src/org/apache/hadoop/net/unix/DomainSocket.c  |  2 +-
 .../maven/plugin/cmakebuilder/CompileMojo.java     | 17 +++++++----------
 .../hadoop/maven/plugin/cmakebuilder/TestMojo.java | 14 +++++++-------
 .../org/apache/hadoop/maven/plugin/util/Exec.java  | 11 +++++++++--
 .../native/container-executor/impl/configuration.c |  2 +-
 6 files changed, 27 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/b2c155f8/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 19f6fec..132d527 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -689,6 +689,8 @@ Release 2.9.0 - UNRELEASED
    HDFS-9517. Fix missing @Test annotation on
    TestDistCpUtils.testUnpackAttributes (Wei-Chiu Chuang via cmccabe)
 
+   HADOOP-12712. Fix some cmake plugin and native build warnings (cmccabe)
+
 Release 2.8.0 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/b2c155f8/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/b2c155f8/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
----------------------------------------------------------------------
diff --git a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
index e44bcf8..afb11cb 100644
--- a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
+++ b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
@@ -22,18 +22,15 @@ import org.apache.maven.plugins.annotations.LifecyclePhase;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 
-import java.io.BufferedReader;
 import java.io.File;
 import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
 import java.util.concurrent.TimeUnit;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
 /**
- * Goal which builds the native sources
+ * Goal which builds the native sources.
  */
 @Mojo(name="cmake-compile", defaultPhase = LifecyclePhase.COMPILE)
 public class CompileMojo extends AbstractMojo {
@@ -203,8 +200,6 @@ public class CompileMojo extends AbstractMojo {
   public void runMake() throws MojoExecutionException {
     List<String> cmd = new LinkedList<String>();
     cmd.add("make");
-    // TODO: it would be nice to determine the number of CPUs and set the
-    // parallelism to that.  It requires some platform-specific logic, though.
     cmd.add("-j");
     cmd.add(String.valueOf(availableProcessors));
     cmd.add("VERBOSE=1");
@@ -259,11 +254,13 @@ public class CompileMojo extends AbstractMojo {
         }
         // We always print stderr, since it contains the compiler warning
         // messages.  These are interesting even if compilation succeeded.
-          for (String line: stderrThread.getOutput()) {
-            getLog().warn(line);
-          }
+        for (String line: stderrThread.getOutput()) {
+          getLog().warn(line);
+        }
+      }
+      if (proc != null) {
+        proc.destroy();
       }
-      if (proc != null) proc.destroy();
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/b2c155f8/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
----------------------------------------------------------------------
diff --git a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
index fa7176b..447331b 100644
--- a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
+++ b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
@@ -60,7 +60,6 @@ public class TestMojo extends AbstractMojo {
 
   /**
    * Environment variables to pass to the binary.
-   *
    */
   @Parameter
   private Map<String, String> env;
@@ -105,7 +104,7 @@ public class TestMojo extends AbstractMojo {
   private String expectedResult;
 
   /**
-   * The Maven Session Object
+   * The Maven Session Object.
    */
   @Parameter(defaultValue="${session}", readonly=true, required=true)
   private MavenSession session;
@@ -205,7 +204,7 @@ public class TestMojo extends AbstractMojo {
   private boolean shouldRunTest() throws MojoExecutionException {
     // Were we told to skip all tests?
     String skipTests = session.
-        getExecutionProperties().getProperty("skipTests");
+        getSystemProperties().getProperty("skipTests");
     if (isTruthy(skipTests)) {
       getLog().info("skipTests is in effect for test " + testName);
       return false;
@@ -223,7 +222,7 @@ public class TestMojo extends AbstractMojo {
     // If there is an explicit list of tests to run, it should include this
     // test.
     String testProp = session.
-        getExecutionProperties().getProperty("test");
+        getSystemProperties().getProperty("test");
     if (testProp != null) {
       String testPropArr[] = testProp.split(",");
       boolean found = false;
@@ -251,8 +250,9 @@ public class TestMojo extends AbstractMojo {
         String val = entry.getValue();
         if (key == null) {
           throw new MojoExecutionException("NULL is not a valid " +
-          		"precondition type.  " + VALID_PRECONDITION_TYPES_STR);
-        } if (key.equals("and")) {
+               "precondition type.  " + VALID_PRECONDITION_TYPES_STR);
+        }
+        if (key.equals("and")) {
           if (!isTruthy(val)) {
             getLog().info("Skipping test " + testName +
                 " because precondition number " + idx + " was not met.");
@@ -267,7 +267,7 @@ public class TestMojo extends AbstractMojo {
           }
         } else {
           throw new MojoExecutionException(key + " is not a valid " +
-          		"precondition type.  " + VALID_PRECONDITION_TYPES_STR);
+              "precondition type.  " + VALID_PRECONDITION_TYPES_STR);
         }
         idx++;
       }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/b2c155f8/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 b0fa3ab..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
@@ -127,9 +127,9 @@ 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;
@@ -138,6 +138,9 @@ public class Exec {
 
   /**
    * 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) {
@@ -156,6 +159,10 @@ public class Exec {
 
   /**
    * 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();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/b2c155f8/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