merge -c 1501600 from branch-2 to branch-2.1 to fix YARN-727, MAPREDUCE-5325. ClientRMProtocol.getAllApplications should accept ApplicationType as a parameter. Contributed by Xuan Gong.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.1-beta@1501601 13f79535-47bb-0310-9956-ffa450edef68
Merge r1501606 from branch-2 to branch-2.1-beta for YARN-369. Handle ( or throw a proper error when receiving) status updates from application masters that have not registered (Mayank Bansal & Abhishek Kapoor via bikas)

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