Merge -r 1475669:1475670 from trunk to branch-2. Fixes: YARN-595. Refactor fair scheduler to use common Resources. Contributed by Sandy Ryza.