Merge -r 1228290:1228291 from trunk to branch-0.22. Fixes: HADOOP-7937

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1228295 13f79535-47bb-0310-9956-ffa450edef68
MAPREDUCE-3593. Fix user impersonation. Contributed by Mayank Bansal.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1229749 13f79535-47bb-0310-9956-ffa450edef68
MAPREDUCE-2539. Fixed NPE in getMapTaskReports in JobClient. Contributed by Robert Evans.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1236961 13f79535-47bb-0310-9956-ffa450edef68
MAPREDUCE-3725. hadoop job -list returns user name as NULL. Contributed by Mayank Bansal.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1239427 13f79535-47bb-0310-9956-ffa450edef68
HDFS-2718. Optimize OP_ADD in edits loading. Contributed by Konstantin Shvachko.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1239762 13f79535-47bb-0310-9956-ffa450edef68
HDFS-2877. If locking of a storage dir fails, it will remove the other NN's lock file on exit. Contributed by Todd Lipcon.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1239878 13f79535-47bb-0310-9956-ffa450edef68
HDFS-2886. CreateEditLogs should generate a realistic edit log. Contributed by Konstantin Shvachko.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1241312 13f79535-47bb-0310-9956-ffa450edef68
MAPREDUCE-3837. Job tracker is not able to recover jobs after crash. Contributed by Mayank Bansal.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1243700 13f79535-47bb-0310-9956-ffa450edef68
HADOOP-7680 TestHardLink fails on Mac OS X, when gnu stat is in path.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1290867 13f79535-47bb-0310-9956-ffa450edef68
HDFS-1601. Pipeline ACKs are sent as lots of tiny TCP packets. Contributed by Todd Lipcon

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1300695 13f79535-47bb-0310-9956-ffa450edef68
HDFS-2991. Fix case where OP_ADD would not be logged in append(). Contributed by Todd Lipcon. 

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1308223 13f79535-47bb-0310-9956-ffa450edef68
HDFS-2246. Enable reading a block directly from local file system for a client on the same node as the block file. Contributed by Andrew Purtell, Suresh, Jitendra and Benoy

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1329468 13f79535-47bb-0310-9956-ffa450edef68
MAPREDUCE-4164. Fix Communication exception thrown after task completion. Contributed by Mayank Bansal.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1329486 13f79535-47bb-0310-9956-ffa450edef68
MAPREDUCE-3863. 0.22 branch mvn deploy is not publishing hadoop-streaming JAR. Contributed by Benoy Antony


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1330126 13f79535-47bb-0310-9956-ffa450edef68
MAPREDUCE-3863. hadoop-streaming-template.xml is missing in the previous commit.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1333256 13f79535-47bb-0310-9956-ffa450edef68
HDFS-3368. Missing blocks due to bad DataNodes coming up and down. Contributed by Konstantin Shvachko.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1342521 13f79535-47bb-0310-9956-ffa450edef68
MAPREDUCE-4240. Revert MAPREDUCE-2767. Contributed by Benoy Antony.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1346206 13f79535-47bb-0310-9956-ffa450edef68
HDFS-3402. Fix hdfs script for secure datanodes. Contributed by Benoy Antony.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1346210 13f79535-47bb-0310-9956-ffa450edef68
MAPREDUCE-4243. Modify mapreduce build to include task-controller target. Contributed by Benoy Antony.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1346211 13f79535-47bb-0310-9956-ffa450edef68
HADOOP-7338. LocalDirAllocator improvements for MR-2178. Contributed by Benoy Antony.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1346212 13f79535-47bb-0310-9956-ffa450edef68