Merge -c 1390218 from trunk to branch-2 to fix YARN-9. Rename YARN_HOME to HADOOP_YARN_HOME. Contributed by Vinod K V.