You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by br...@apache.org on 2013/06/12 21:17:01 UTC

[1/3] git commit: Run Hadoop tutorial binaries from within build dir.

Updated Branches:
  refs/heads/master e43c46eef -> 46644b668


Run Hadoop tutorial binaries from within build dir.

Review: https://reviews.apache.org/r/11109


Project: http://git-wip-us.apache.org/repos/asf/incubator-mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mesos/commit/234dbcf0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mesos/tree/234dbcf0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mesos/diff/234dbcf0

Branch: refs/heads/master
Commit: 234dbcf016777fa3d7fb184b6f5d0e7f73bdb1ab
Parents: e43c46e
Author: Brenden Matthews <br...@airbnb.com>
Authored: Mon Apr 15 14:08:01 2013 -0700
Committer: Brenden Matthews <br...@airbnb.com>
Committed: Wed Jun 12 12:08:13 2013 -0700

----------------------------------------------------------------------
 hadoop/TUTORIAL.sh                              | 21 +++++++++++---------
 .../apache/hadoop/mapred/MesosScheduler.java    |  2 +-
 2 files changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/234dbcf0/hadoop/TUTORIAL.sh
----------------------------------------------------------------------
diff --git a/hadoop/TUTORIAL.sh b/hadoop/TUTORIAL.sh
index d81c555..2a8a2e8 100755
--- a/hadoop/TUTORIAL.sh
+++ b/hadoop/TUTORIAL.sh
@@ -575,16 +575,20 @@ __EOF__
 # We re-name the directory to 'hadoop' so that the Mesos executor
 # can be agnostic to the Hadoop version.
 execute "cd .." \
-  "mv ${hadoop} hadoop" \
-  "tar czf hadoop.tar.gz hadoop"
+  "mv ${hadoop} ${hadoop}-mesos" \
+  "tar czf ${hadoop}-mesos.tar.gz ${hadoop}-mesos/"
 
 # Start JobTracker.
 cat <<__EOF__
 
-${GREEN}Build success!${NORMAL} Now let's run something!
+${GREEN}Build success!${NORMAL}
 
-Let's go ahead and try and start the JobTracker via:
-  $ cd ..
+The Mesos distribution is now built in '${hadoop}-mesos'
+
+Now let's run something!
+
+We'll try and start the JobTracker from the Mesos distribution path via:
+  $ cd ${hadoop}-mesos
   $ ./bin/hadoop jobtracker
 
 __EOF__
@@ -598,7 +602,7 @@ echo
 # launch TaskTrackers.
 # TODO(vinod): Pipe these commands through 'execute()' so that they
 # can be appended to the summary.
-cd ..
+cd ${hadoop}-mesos
 export MESOS_RESOURCES="cpus:16;mem:16384;disk:307200;ports:[31000-32000]"
 ./bin/hadoop jobtracker 1>/dev/null 2>&1 &
 
@@ -614,14 +618,13 @@ echo -n "Waiting 5 seconds for it to start."
 
 for i in 1 2 3 4 5; do sleep 1 && echo -n " ."; done
 
-
 # Now let's run an example.
 cat <<__EOF__
 
 Alright, now let's run the "wordcount" example via:
 
   $ ./bin/hadoop jar hadoop-examples-${distribution}.jar wordcount \
-  src/contrib/mesos/src/java/org/apache/hadoop/mapred out
+  ${MESOS_BUILD_DIR}/src/mesos out
 
 __EOF__
 
@@ -631,7 +634,7 @@ echo
 rm -rf out # TODO(benh): Ask about removing this first.
 
 ./bin/hadoop jar hadoop-examples-${distribution}.jar wordcount \
-    src/contrib/mesos/src/java/org/apache/hadoop/mapred out
+    ${MESOS_BUILD_DIR}/src/mesos out
 
 
 if test ${?} == "0"; then

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/234dbcf0/hadoop/mesos/src/java/org/apache/hadoop/mapred/MesosScheduler.java
----------------------------------------------------------------------
diff --git a/hadoop/mesos/src/java/org/apache/hadoop/mapred/MesosScheduler.java b/hadoop/mesos/src/java/org/apache/hadoop/mapred/MesosScheduler.java
index afe401f..c5a63bc 100644
--- a/hadoop/mesos/src/java/org/apache/hadoop/mapred/MesosScheduler.java
+++ b/hadoop/mesos/src/java/org/apache/hadoop/mapred/MesosScheduler.java
@@ -493,7 +493,7 @@ public class MesosScheduler extends TaskScheduler implements Scheduler {
           String uri = conf.get("mapred.mesos.executor");
           commandInfo = CommandInfo.newBuilder()
               .setEnvironment(envBuilder)
-              .setValue("cd hadoop && ./bin/mesos-executor")
+              .setValue("cd hadoop-* && ./bin/mesos-executor")
               .addUris(CommandInfo.URI.newBuilder().setValue(uri)).build();
         }
 


[3/3] git commit: Hadoop tutorial version bump (CDH4.2.0 -> 4.2.1).

Posted by br...@apache.org.
Hadoop tutorial version bump (CDH4.2.0 -> 4.2.1).

Review: https://reviews.apache.org/r/11120


Project: http://git-wip-us.apache.org/repos/asf/incubator-mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mesos/commit/46644b66
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mesos/tree/46644b66
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mesos/diff/46644b66

Branch: refs/heads/master
Commit: 46644b668b75f86c75bf42e35ff6bd52691865ec
Parents: c07256e
Author: Brenden Matthews <br...@airbnb.com>
Authored: Fri Apr 26 15:36:54 2013 -0700
Committer: Brenden Matthews <br...@airbnb.com>
Committed: Wed Jun 12 12:08:17 2013 -0700

----------------------------------------------------------------------
 hadoop/HadoopPipes.cc.patch                     |  4 ++--
 hadoop/Makefile.am                              | 24 ++++++++++----------
 hadoop/TUTORIAL.sh                              | 12 +++++-----
 ...adoop-2.0.0-mr1-cdh4.2.0_hadoop-env.sh.patch | 14 ------------
 hadoop/hadoop-2.0.0-mr1-cdh4.2.0_mesos.patch    | 22 ------------------
 ...adoop-2.0.0-mr1-cdh4.2.1_hadoop-env.sh.patch | 14 ++++++++++++
 hadoop/hadoop-2.0.0-mr1-cdh4.2.1_mesos.patch    | 22 ++++++++++++++++++
 7 files changed, 56 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/46644b66/hadoop/HadoopPipes.cc.patch
----------------------------------------------------------------------
diff --git a/hadoop/HadoopPipes.cc.patch b/hadoop/HadoopPipes.cc.patch
index aa5df7c..e0ca33a 100644
--- a/hadoop/HadoopPipes.cc.patch
+++ b/hadoop/HadoopPipes.cc.patch
@@ -1,5 +1,5 @@
---- hadoop-2.0.0-mr1-cdh4.2.0/src/c++/pipes/impl/HadoopPipes.cc.old	2013-04-16 20:18:22.681061322 +0000
-+++ hadoop-2.0.0-mr1-cdh4.2.0/src/c++/pipes/impl/HadoopPipes.cc	2013-04-16 20:18:44.005060961 +0000
+--- hadoop-2.0.0-mr1-cdh4.2.1/src/c++/pipes/impl/HadoopPipes.cc.old	2013-04-16 20:18:22.681061322 +0000
++++ hadoop-2.0.0-mr1-cdh4.2.1/src/c++/pipes/impl/HadoopPipes.cc	2013-04-16 20:18:44.005060961 +0000
 @@ -34,6 +34,7 @@
  #include <pthread.h>
  #include <iostream>

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/46644b66/hadoop/Makefile.am
----------------------------------------------------------------------
diff --git a/hadoop/Makefile.am b/hadoop/Makefile.am
index f32f268..1bfa47f 100644
--- a/hadoop/Makefile.am
+++ b/hadoop/Makefile.am
@@ -19,8 +19,8 @@ EXTRA_DIST = TUTORIAL.sh hadoop-gridmix.patch				\
   hadoop-0.20.2-cdh3u3_mesos.patch					\
   hadoop-2.0.0-mr1-cdh4.1.2_hadoop-env.sh.patch				\
   hadoop-2.0.0-mr1-cdh4.1.2_mesos.patch					\
-  hadoop-2.0.0-mr1-cdh4.2.0_hadoop-env.sh.patch				\
-  hadoop-2.0.0-mr1-cdh4.2.0_mesos.patch					\
+  hadoop-2.0.0-mr1-cdh4.2.1_hadoop-env.sh.patch				\
+  hadoop-2.0.0-mr1-cdh4.2.1_mesos.patch					\
   hadoop-7698-1.patch							\
   hadoop-0.20.205.0_hadoop-env.sh.patch hadoop-0.20.205.0_mesos.patch	\
   HadoopPipes.cc.patch                                                  \
@@ -75,19 +75,19 @@ hadoop-2.0.0-mr1-cdh4.1.2:
 	rm -rf hadoop-2.0.0-mr1-cdh4.1.2
 	@TMOUT=1 JAVA_HOME=$(JAVA_HOME) ./TUTORIAL.sh 2.0.0-mr1-cdh4.1.2
 
-hadoop-2.0.0-mr1-cdh4.2.0:
+hadoop-2.0.0-mr1-cdh4.2.1:
 	if test "$(top_srcdir)" != "$(top_builddir)"; then \
           cp -p $(srcdir)/TUTORIAL.sh .; \
           cp -p $(srcdir)/hadoop-gridmix.patch .; \
-          cp -p $(srcdir)/hadoop-2.0.0-mr1-cdh4.2.0_hadoop-env.sh.patch .; \
-          cp -p $(srcdir)/hadoop-2.0.0-mr1-cdh4.2.0_mesos.patch .; \
+          cp -p $(srcdir)/hadoop-2.0.0-mr1-cdh4.2.1_hadoop-env.sh.patch .; \
+          cp -p $(srcdir)/hadoop-2.0.0-mr1-cdh4.2.1_mesos.patch .; \
           cp -p $(srcdir)/mapred-site.xml.patch .; \
           cp -p $(srcdir)/HadoopPipes.cc.patch .; \
           cp -rp $(srcdir)/mesos .; \
           cp -p $(srcdir)/mesos-executor .; \
         fi
-	rm -rf hadoop-2.0.0-mr1-cdh4.2.0
-	@TMOUT=1 JAVA_HOME=$(JAVA_HOME) ./TUTORIAL.sh 2.0.0-mr1-cdh4.2.0
+	rm -rf hadoop-2.0.0-mr1-cdh4.2.1
+	@TMOUT=1 JAVA_HOME=$(JAVA_HOME) ./TUTORIAL.sh 2.0.0-mr1-cdh4.2.1
 
 
 clean-local:
@@ -99,8 +99,8 @@ clean-local:
           rm -f hadoop-0.20.2-cdh3u3_mesos.patch; \
           rm -f hadoop-2.0.0-mr1-cdh4.1.2_hadoop-env.sh.patch; \
           rm -f hadoop-2.0.0-mr1-cdh4.1.2_mesos.patch; \
-          rm -f hadoop-2.0.0-mr1-cdh4.2.0_hadoop-env.sh.patch; \
-          rm -f hadoop-2.0.0-mr1-cdh4.2.0_mesos.patch; \
+          rm -f hadoop-2.0.0-mr1-cdh4.2.1_hadoop-env.sh.patch; \
+          rm -f hadoop-2.0.0-mr1-cdh4.2.1_mesos.patch; \
           rm -f hadoop-0.20.205.0_hadoop-env.sh.patch; \
           rm -f hadoop-0.20.205.0_mesos.patch; \
           rm -f mapred-site.xml.patch; \
@@ -111,10 +111,10 @@ clean-local:
 	rm -f hadoop-0.20.2-cdh3u3.tar.gz
 	rm -rf hadoop-2.0.0-mr1-cdh4.1.2
 	rm -f mr1-2.0.0-mr1-cdh4.1.2.tar.gz
-	rm -rf hadoop-2.0.0-mr1-cdh4.2.0
-	rm -f mr1-2.0.0-mr1-cdh4.2.0.tar.gz
+	rm -rf hadoop-2.0.0-mr1-cdh4.2.1
+	rm -f mr1-2.0.0-mr1-cdh4.2.1.tar.gz
 	rm -rf hadoop-0.20.205.0
 	rm -f hadoop-0.20.205.0.tar.gz
 
 
-.PHONY: hadoop-0.20.205.0 hadoop-0.20.2-cdh3u3 hadoop-2.0.0-mr1-cdh4.1.2 hadoop-2.0.0-mr1-cdh4.2.0
+.PHONY: hadoop-0.20.205.0 hadoop-0.20.2-cdh3u3 hadoop-2.0.0-mr1-cdh4.1.2 hadoop-2.0.0-mr1-cdh4.2.1

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/46644b66/hadoop/TUTORIAL.sh
----------------------------------------------------------------------
diff --git a/hadoop/TUTORIAL.sh b/hadoop/TUTORIAL.sh
index aafbfdb..209099d 100755
--- a/hadoop/TUTORIAL.sh
+++ b/hadoop/TUTORIAL.sh
@@ -13,10 +13,10 @@ elif test "${1}" = "2.0.0-mr1-cdh4.1.2"; then
     distribution="2.0.0-mr1-cdh4.1.2"
     url="http://archive.cloudera.com/cdh4/cdh/4"
     bundle="mr1-2.0.0-mr1-cdh4.1.2.tar.gz"
-elif test "${1}" = "2.0.0-mr1-cdh4.2.0"; then
-    distribution="2.0.0-mr1-cdh4.2.0"
+elif test "${1}" = "2.0.0-mr1-cdh4.2.1"; then
+    distribution="2.0.0-mr1-cdh4.2.1"
     url="http://archive.cloudera.com/cdh4/cdh/4"
-    bundle="mr1-2.0.0-mr1-cdh4.2.0.tar.gz"
+    bundle="mr1-2.0.0-mr1-cdh4.2.1.tar.gz"
 fi
 
 hadoop="hadoop-${distribution}"
@@ -94,7 +94,7 @@ if test ${distribution} = "0.20.205.0"; then
     resources="${resources} hadoop-7698-1.patch"
 fi
 
-if test ${distribution} = "2.0.0-mr1-cdh4.1.2" -o ${distribution} = "2.0.0-mr1-cdh4.2.0"; then
+if test ${distribution} = "2.0.0-mr1-cdh4.1.2" -o ${distribution} = "2.0.0-mr1-cdh4.2.1"; then
     resources="${resources} HadoopPipes.cc.patch"
 fi
 
@@ -519,7 +519,7 @@ if test ${REPLY} == "Y" -o ${REPLY} == "y"; then
     execute "patch -p1 <../${hadoop}_hadoop-env.sh.patch"
 fi
 
-if test ${distribution} = "2.0.0-mr1-cdh4.1.2" -o ${distribution} = "2.0.0-mr1-cdh4.2.0"; then
+if test ${distribution} = "2.0.0-mr1-cdh4.1.2" -o ${distribution} = "2.0.0-mr1-cdh4.2.1"; then
     # Apply HadoopPipes.cc patch.
     cat <<__EOF__
 
@@ -568,7 +568,7 @@ __EOF__
 read -e -p "${BRIGHT}Hit enter to continue.${NORMAL} "
 echo
 
-if test ${distribution} = "2.0.0-mr1-cdh4.1.2" -o ${distribution} = "2.0.0-mr1-cdh4.2.0"; then
+if test ${distribution} = "2.0.0-mr1-cdh4.1.2" -o ${distribution} = "2.0.0-mr1-cdh4.2.1"; then
   cat <<__EOF__
 
   We need to chmod +x install-sh scripts to compile

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/46644b66/hadoop/hadoop-2.0.0-mr1-cdh4.2.0_hadoop-env.sh.patch
----------------------------------------------------------------------
diff --git a/hadoop/hadoop-2.0.0-mr1-cdh4.2.0_hadoop-env.sh.patch b/hadoop/hadoop-2.0.0-mr1-cdh4.2.0_hadoop-env.sh.patch
deleted file mode 100644
index b915b1d..0000000
--- a/hadoop/hadoop-2.0.0-mr1-cdh4.2.0_hadoop-env.sh.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/conf/hadoop-env.sh b/conf/hadoop-env.sh
-index ada5bef..76aaf48 100644
---- a/conf/hadoop-env.sh
-+++ b/conf/hadoop-env.sh
-@@ -9,7 +9,8 @@
- # export JAVA_HOME=/usr/lib/j2sdk1.6-sun
- 
- # Extra Java CLASSPATH elements.  Optional.
--# export HADOOP_CLASSPATH="<extra_entries>:$HADOOP_CLASSPATH"
-+MESOS_CLASSPATH=${HADOOP_HOME}/contrib/mesos/hadoop-mesos-2.0.0-mr1-cdh4.2.0.jar:${HADOOP_HOME}/build/contrib/mesos/hadoop-mesos-2.0.0-mr1-cdh4.2.0.jar
-+export HADOOP_CLASSPATH=${MESOS_CLASSPATH}:${HADOOP_CLASSPATH}
-
- # The maximum amount of heap to use, in MB. Default is 1000.
- # export HADOOP_HEAPSIZE=2000

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/46644b66/hadoop/hadoop-2.0.0-mr1-cdh4.2.0_mesos.patch
----------------------------------------------------------------------
diff --git a/hadoop/hadoop-2.0.0-mr1-cdh4.2.0_mesos.patch b/hadoop/hadoop-2.0.0-mr1-cdh4.2.0_mesos.patch
deleted file mode 100644
index 8a39444..0000000
--- a/hadoop/hadoop-2.0.0-mr1-cdh4.2.0_mesos.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/ivy/libraries.properties b/ivy/libraries.properties
-index b47b4c3..713f0c1 100644
---- a/ivy/libraries.properties
-+++ b/ivy/libraries.properties
-@@ -86,3 +86,5 @@ slf4j-log4j12.version=1.4.3
- xerces.version=1.4.4
-
- zookeeper.version=3.4.2
-+
-+protobuf-java.version=2.4.1
-diff --git a/src/contrib/build.xml b/src/contrib/build.xml
-index 3c19e25..ecb7198 100644
---- a/src/contrib/build.xml
-+++ b/src/contrib/build.xml
-@@ -54,6 +54,7 @@
-       <fileset dir="." includes="fairscheduler/build.xml"/>
-       <fileset dir="." includes="capacity-scheduler/build.xml"/>
-       <!-- <fileset dir="." includes="gridmix/build.xml"/> -->
-+      <fileset dir="." includes="mesos/build.xml"/>
-     </subant>
-      <available file="${build.contrib.dir}/testsfailed" property="testsfailed"/>
-      <fail if="testsfailed">Tests failed!</fail>

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/46644b66/hadoop/hadoop-2.0.0-mr1-cdh4.2.1_hadoop-env.sh.patch
----------------------------------------------------------------------
diff --git a/hadoop/hadoop-2.0.0-mr1-cdh4.2.1_hadoop-env.sh.patch b/hadoop/hadoop-2.0.0-mr1-cdh4.2.1_hadoop-env.sh.patch
new file mode 100644
index 0000000..d57c1e7
--- /dev/null
+++ b/hadoop/hadoop-2.0.0-mr1-cdh4.2.1_hadoop-env.sh.patch
@@ -0,0 +1,14 @@
+diff --git a/conf/hadoop-env.sh b/conf/hadoop-env.sh
+index ada5bef..76aaf48 100644
+--- a/conf/hadoop-env.sh
++++ b/conf/hadoop-env.sh
+@@ -9,7 +9,8 @@
+ # export JAVA_HOME=/usr/lib/j2sdk1.6-sun
+ 
+ # Extra Java CLASSPATH elements.  Optional.
+-# export HADOOP_CLASSPATH="<extra_entries>:$HADOOP_CLASSPATH"
++MESOS_CLASSPATH=${HADOOP_HOME}/contrib/mesos/hadoop-mesos-2.0.0-mr1-cdh4.2.1.jar:${HADOOP_HOME}/build/contrib/mesos/hadoop-mesos-2.0.0-mr1-cdh4.2.1.jar
++export HADOOP_CLASSPATH=${MESOS_CLASSPATH}:${HADOOP_CLASSPATH}
+
+ # The maximum amount of heap to use, in MB. Default is 1000.
+ # export HADOOP_HEAPSIZE=2000

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/46644b66/hadoop/hadoop-2.0.0-mr1-cdh4.2.1_mesos.patch
----------------------------------------------------------------------
diff --git a/hadoop/hadoop-2.0.0-mr1-cdh4.2.1_mesos.patch b/hadoop/hadoop-2.0.0-mr1-cdh4.2.1_mesos.patch
new file mode 100644
index 0000000..8a39444
--- /dev/null
+++ b/hadoop/hadoop-2.0.0-mr1-cdh4.2.1_mesos.patch
@@ -0,0 +1,22 @@
+diff --git a/ivy/libraries.properties b/ivy/libraries.properties
+index b47b4c3..713f0c1 100644
+--- a/ivy/libraries.properties
++++ b/ivy/libraries.properties
+@@ -86,3 +86,5 @@ slf4j-log4j12.version=1.4.3
+ xerces.version=1.4.4
+
+ zookeeper.version=3.4.2
++
++protobuf-java.version=2.4.1
+diff --git a/src/contrib/build.xml b/src/contrib/build.xml
+index 3c19e25..ecb7198 100644
+--- a/src/contrib/build.xml
++++ b/src/contrib/build.xml
+@@ -54,6 +54,7 @@
+       <fileset dir="." includes="fairscheduler/build.xml"/>
+       <fileset dir="." includes="capacity-scheduler/build.xml"/>
+       <!-- <fileset dir="." includes="gridmix/build.xml"/> -->
++      <fileset dir="." includes="mesos/build.xml"/>
+     </subant>
+      <available file="${build.contrib.dir}/testsfailed" property="testsfailed"/>
+      <fail if="testsfailed">Tests failed!</fail>


[2/3] git commit: Build fix for HadoopPipes.cc with GCC 4.7.

Posted by br...@apache.org.
Build fix for HadoopPipes.cc with GCC 4.7.

Review: https://reviews.apache.org/r/11113


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

Branch: refs/heads/master
Commit: c07256e3706e56e98263533c117c7b862a172bf2
Parents: 234dbcf
Author: Brenden Matthews <br...@airbnb.com>
Authored: Tue Apr 16 13:22:10 2013 -0700
Committer: Brenden Matthews <br...@airbnb.com>
Committed: Wed Jun 12 12:08:17 2013 -0700

----------------------------------------------------------------------
 hadoop/HadoopPipes.cc.patch | 10 ++++++++++
 hadoop/Makefile.am          |  3 +++
 hadoop/TUTORIAL.sh          | 43 ++++++++++++++++++++++++++++++++++++++--
 3 files changed, 54 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/c07256e3/hadoop/HadoopPipes.cc.patch
----------------------------------------------------------------------
diff --git a/hadoop/HadoopPipes.cc.patch b/hadoop/HadoopPipes.cc.patch
new file mode 100644
index 0000000..aa5df7c
--- /dev/null
+++ b/hadoop/HadoopPipes.cc.patch
@@ -0,0 +1,10 @@
+--- hadoop-2.0.0-mr1-cdh4.2.0/src/c++/pipes/impl/HadoopPipes.cc.old	2013-04-16 20:18:22.681061322 +0000
++++ hadoop-2.0.0-mr1-cdh4.2.0/src/c++/pipes/impl/HadoopPipes.cc	2013-04-16 20:18:44.005060961 +0000
+@@ -34,6 +34,7 @@
+ #include <pthread.h>
+ #include <iostream>
+ #include <fstream>
++#include <unistd.h>
+ 
+ #include <openssl/hmac.h>
+ #include <openssl/buffer.h>

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/c07256e3/hadoop/Makefile.am
----------------------------------------------------------------------
diff --git a/hadoop/Makefile.am b/hadoop/Makefile.am
index ceac085..f32f268 100644
--- a/hadoop/Makefile.am
+++ b/hadoop/Makefile.am
@@ -23,6 +23,7 @@ EXTRA_DIST = TUTORIAL.sh hadoop-gridmix.patch				\
   hadoop-2.0.0-mr1-cdh4.2.0_mesos.patch					\
   hadoop-7698-1.patch							\
   hadoop-0.20.205.0_hadoop-env.sh.patch hadoop-0.20.205.0_mesos.patch	\
+  HadoopPipes.cc.patch                                                  \
   mapred-site.xml.patch mesos-executor mesos/build.xml			\
   mesos/ivy/libraries.properties mesos/ivy.xml				\
   mesos/src/java/org/apache/hadoop/mapred/MesosExecutor.java		\
@@ -67,6 +68,7 @@ hadoop-2.0.0-mr1-cdh4.1.2:
           cp -p $(srcdir)/hadoop-2.0.0-mr1-cdh4.1.2_hadoop-env.sh.patch .; \
           cp -p $(srcdir)/hadoop-2.0.0-mr1-cdh4.1.2_mesos.patch .; \
           cp -p $(srcdir)/mapred-site.xml.patch .; \
+          cp -p $(srcdir)/HadoopPipes.cc.patch .; \
           cp -rp $(srcdir)/mesos .; \
           cp -p $(srcdir)/mesos-executor .; \
         fi
@@ -80,6 +82,7 @@ hadoop-2.0.0-mr1-cdh4.2.0:
           cp -p $(srcdir)/hadoop-2.0.0-mr1-cdh4.2.0_hadoop-env.sh.patch .; \
           cp -p $(srcdir)/hadoop-2.0.0-mr1-cdh4.2.0_mesos.patch .; \
           cp -p $(srcdir)/mapred-site.xml.patch .; \
+          cp -p $(srcdir)/HadoopPipes.cc.patch .; \
           cp -rp $(srcdir)/mesos .; \
           cp -p $(srcdir)/mesos-executor .; \
         fi

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/c07256e3/hadoop/TUTORIAL.sh
----------------------------------------------------------------------
diff --git a/hadoop/TUTORIAL.sh b/hadoop/TUTORIAL.sh
index 2a8a2e8..aafbfdb 100755
--- a/hadoop/TUTORIAL.sh
+++ b/hadoop/TUTORIAL.sh
@@ -94,6 +94,10 @@ if test ${distribution} = "0.20.205.0"; then
     resources="${resources} hadoop-7698-1.patch"
 fi
 
+if test ${distribution} = "2.0.0-mr1-cdh4.1.2" -o ${distribution} = "2.0.0-mr1-cdh4.2.0"; then
+    resources="${resources} HadoopPipes.cc.patch"
+fi
+
 for resource in `echo ${resources}`; do
     if test ! -e ${resource}; then
         cat <<__EOF__
@@ -111,7 +115,7 @@ __EOF__
     fi
 done
 
-# Make sure we have all the programs we need.
+# Make sure we have all the build tools we need.
 programs="mvn \
   ant"
 
@@ -120,7 +124,7 @@ for program in `echo ${programs}`; do
     if test "$?" != 0; then
         cat <<__EOF__
 
-${RED}We seem to be missing ${program} from the path.  Please install
+${RED}We seem to be missing ${program} from PATH.  Please install
 ${program} and re-run this tutorial.  If you still have troubles, please report
 this to:
 
@@ -515,6 +519,41 @@ if test ${REPLY} == "Y" -o ${REPLY} == "y"; then
     execute "patch -p1 <../${hadoop}_hadoop-env.sh.patch"
 fi
 
+if test ${distribution} = "2.0.0-mr1-cdh4.1.2" -o ${distribution} = "2.0.0-mr1-cdh4.2.0"; then
+    # Apply HadoopPipes.cc patch.
+    cat <<__EOF__
+
+    This version of Hadoop needs to be patched to build on GCC 4.7 and newer compilers.
+
+__EOF__
+
+    read -e -p "${BRIGHT}Hit enter to continue.${NORMAL} "
+    echo
+
+    patch --dry-run --silent --force -p1 \
+	<../HadoopPipes.cc.patch 1>/dev/null 2>&1
+
+    if test ${?} == "1"; then
+	cat <<__EOF__
+
+    ${RED}It looks like conf/hadoop-env.sh has been modified. You'll need
+    to copy that to something else and restore the file to it's original
+    contents before we'll be able to apply this patch.${NORMAL}
+
+__EOF__
+	DEFAULT="N"
+    else
+	DEFAULT="Y"
+    fi
+
+    read -e -p "${BRIGHT}Patch src/c++/pipes/impl/HadoopPipes.cc?${NORMAL} [${DEFAULT}] "
+    echo
+    test -z ${REPLY} && REPLY=${DEFAULT}
+    if test ${REPLY} == "Y" -o ${REPLY} == "y"; then
+	execute "patch -p1 <../HadoopPipes.cc.patch"
+    fi
+fi
+
 # Build Hadoop and Mesos executor package that Mesos slaves can download
 # and execute.
 # TODO(vinod): Create a new ant target in build.xml that builds the executor.