From 19b36f09009a6d74fe1273f93aa21d8f40969e80 Mon Sep 17 00:00:00 2001 From: Alejandro Abdelnur Date: Mon, 12 Aug 2013 22:15:10 +0000 Subject: [PATCH] HADOOP-9845. Update protobuf to 2.5 from 2.4.x. (tucu) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1513281 13f79535-47bb-0310-9956-ffa450edef68 --- .../hadoop-common/CHANGES.txt | 2 ++ hadoop-common-project/hadoop-common/pom.xml | 2 ++ hadoop-hdfs-project/hadoop-hdfs/pom.xml | 4 +++ .../hadoop-hdfs/src/contrib/bkjournal/pom.xml | 1 + .../hadoop-mapreduce-client-common/pom.xml | 1 + .../hadoop-mapreduce-client-hs/pom.xml | 1 + .../maven/plugin/protoc/ProtocMojo.java | 31 +++++++++++++++++-- hadoop-project/pom.xml | 6 +++- .../hadoop-yarn/hadoop-yarn-api/pom.xml | 1 + .../hadoop-yarn-server-common/pom.xml | 1 + .../hadoop-yarn-server-nodemanager/pom.xml | 1 + 11 files changed, 47 insertions(+), 4 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 2863a8a7d0c..a7ee6f79fb5 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -105,6 +105,8 @@ Trunk (Unreleased) HADOOP-9833 move slf4j to version 1.7.5 (Kousuke Saruta via stevel) + HADOOP-9845. Update protobuf to 2.5 from 2.4.x. (tucu) + BUG FIXES HADOOP-9451. Fault single-layer config if node group topology is enabled. diff --git a/hadoop-common-project/hadoop-common/pom.xml b/hadoop-common-project/hadoop-common/pom.xml index a59157d5d34..36c32607b9b 100644 --- a/hadoop-common-project/hadoop-common/pom.xml +++ b/hadoop-common-project/hadoop-common/pom.xml @@ -308,6 +308,7 @@ protoc + ${protobuf.version} ${basedir}/src/main/proto @@ -336,6 +337,7 @@ protoc + ${protobuf.version} ${basedir}/src/test/proto diff --git a/hadoop-hdfs-project/hadoop-hdfs/pom.xml b/hadoop-hdfs-project/hadoop-hdfs/pom.xml index 788022e7093..dd9b960eece 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/pom.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/pom.xml @@ -417,6 +417,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> protoc + 2.5.0 ${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto ${basedir}/src/main/proto @@ -441,6 +442,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> protoc + 2.5.0 ${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto ${basedir}/src/main/proto @@ -462,6 +464,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> protoc + 2.5.0 ${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto ${basedir}/src/main/proto @@ -483,6 +486,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> protoc + 2.5.0 ${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto ${basedir}/src/main/proto diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/pom.xml b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/pom.xml index 4248e5bbb20..a306433776e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/pom.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/pom.xml @@ -103,6 +103,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> protoc + 2.5.0 ${basedir}/../../../../../hadoop-common-project/hadoop-common/src/main/proto ${basedir}/../../../../../hadoop-hdfs-project/hadoop-hdfs/src/main/proto diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/pom.xml b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/pom.xml index c7710f97656..39a2ecbe942 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/pom.xml +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/pom.xml @@ -64,6 +64,7 @@ protoc + 2.5.0 ${basedir}/../../../hadoop-common-project/hadoop-common/src/main/proto ${basedir}/../../../hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/pom.xml b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/pom.xml index dc6bbcdfa42..0d9ccf8c7f3 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/pom.xml +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/pom.xml @@ -78,6 +78,7 @@ protoc + 2.5.0 ${basedir}/../../../../hadoop-common-project/hadoop-common/src/main/proto diff --git a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java index 47e97db9ef7..51901ff14d5 100644 --- a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java +++ b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java @@ -48,16 +48,41 @@ public class ProtocMojo extends AbstractMojo { @Parameter(defaultValue="protoc") private String protocCommand; + @Parameter(required=true) + private String protocVersion; public void execute() throws MojoExecutionException { try { + List command = new ArrayList(); + command.add(protocCommand); + command.add("--version"); + Exec exec = new Exec(this); + List out = new ArrayList(); + if (exec.run(command, out) != 0) { + getLog().error("protoc, could not get version"); + for (String s : out) { + getLog().error(s); + } + throw new MojoExecutionException("protoc failure"); + } else { + if (out.size() == 0) { + throw new MojoExecutionException( + "'protoc -version' did not return a version"); + } else { + if (!out.get(0).endsWith(protocVersion)) { + throw new MojoExecutionException( + "protoc version is '" + out.get(0) + "', expected version is '" + + protocVersion + "'"); + } + } + } if (!output.mkdirs()) { if (!output.exists()) { throw new MojoExecutionException("Could not create directory: " + output); } } - List command = new ArrayList(); + command = new ArrayList(); command.add(protocCommand); command.add("--java_out=" + output.getCanonicalPath()); if (imports != null) { @@ -68,8 +93,8 @@ public class ProtocMojo extends AbstractMojo { for (File f : FileSetUtils.convertFileSetToFiles(source)) { command.add(f.getCanonicalPath()); } - Exec exec = new Exec(this); - List out = new ArrayList(); + exec = new Exec(this); + out = new ArrayList(); if (exec.run(command, out) != 0) { getLog().error("protoc compiler error"); for (String s : out) { diff --git a/hadoop-project/pom.xml b/hadoop-project/pom.xml index dc928d27480..098550c6e40 100644 --- a/hadoop-project/pom.xml +++ b/hadoop-project/pom.xml @@ -58,6 +58,10 @@ ${basedir}/../../hadoop-common-project/hadoop-common/target file:///dev/urandom + + + + 2.5.0 @@ -609,7 +613,7 @@ com.google.protobuf protobuf-java - 2.4.0a + ${protobuf.version} commons-daemon diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/pom.xml index 5e6b9e27aa3..9c716cde260 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/pom.xml +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/pom.xml @@ -45,6 +45,7 @@ protoc + 2.5.0 ${basedir}/../../../hadoop-common-project/hadoop-common/src/main/proto ${basedir}/src/main/proto diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/pom.xml index 569ac197c4a..d987f407c0d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/pom.xml +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/pom.xml @@ -73,6 +73,7 @@ protoc + 2.5.0 ${basedir}/../../../../hadoop-common-project/hadoop-common/src/main/proto ${basedir}/../../hadoop-yarn-api/src/main/proto diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/pom.xml index 16fe8415535..f42d567b16e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/pom.xml +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/pom.xml @@ -165,6 +165,7 @@ protoc + 2.5.0 ${basedir}/../../../../hadoop-common-project/hadoop-common/src/main/proto ${basedir}/../../hadoop-yarn-api/src/main/proto