You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by ha...@apache.org on 2017/06/02 01:31:26 UTC
tez git commit: TEZ-3749. Get map and reduce task memory from
JobConf. (harishjp)
Repository: tez
Updated Branches:
refs/heads/master 7f026a878 -> 1250ef59d
TEZ-3749. Get map and reduce task memory from JobConf. (harishjp)
Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/1250ef59
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/1250ef59
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/1250ef59
Branch: refs/heads/master
Commit: 1250ef59d28dd2a2cfafc8621fdf6fb551799ff8
Parents: 7f026a8
Author: Harish JP <ha...@gmail.com>
Authored: Fri Jun 2 07:01:15 2017 +0530
Committer: Harish JP <ha...@gmail.com>
Committed: Fri Jun 2 07:01:15 2017 +0530
----------------------------------------------------------------------
.../org/apache/tez/mapreduce/hadoop/MRHelpers.java | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tez/blob/1250ef59/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRHelpers.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRHelpers.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRHelpers.java
index 76d3849..efd6463 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRHelpers.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRHelpers.java
@@ -328,10 +328,9 @@ public class MRHelpers {
* running Map tasks
*/
public static Resource getResourceForMRMapper(Configuration conf) {
- return Resource.newInstance(conf.getInt(
- MRJobConfig.MAP_MEMORY_MB, MRJobConfig.DEFAULT_MAP_MEMORY_MB),
- conf.getInt(MRJobConfig.MAP_CPU_VCORES,
- MRJobConfig.DEFAULT_MAP_CPU_VCORES));
+ JobConf jobConf = conf instanceof JobConf ? (JobConf)conf : new JobConf(conf);
+ return Resource.newInstance((int)jobConf.getMemoryForMapTask(),
+ jobConf.getInt(MRJobConfig.MAP_CPU_VCORES, MRJobConfig.DEFAULT_MAP_CPU_VCORES));
}
/**
@@ -351,10 +350,9 @@ public class MRHelpers {
* running Reduce tasks
*/
public static Resource getResourceForMRReducer(Configuration conf) {
- return Resource.newInstance(conf.getInt(
- MRJobConfig.REDUCE_MEMORY_MB, MRJobConfig.DEFAULT_REDUCE_MEMORY_MB),
- conf.getInt(MRJobConfig.REDUCE_CPU_VCORES,
- MRJobConfig.DEFAULT_REDUCE_CPU_VCORES));
+ JobConf jobConf = conf instanceof JobConf ? (JobConf)conf : new JobConf(conf);
+ return Resource.newInstance((int)jobConf.getMemoryForReduceTask(),
+ conf.getInt(MRJobConfig.REDUCE_CPU_VCORES, MRJobConfig.DEFAULT_REDUCE_CPU_VCORES));
}
/**