tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From haris...@apache.org
Subject tez git commit: TEZ-3749. Get map and reduce task memory from JobConf. (harishjp)
Date Fri, 02 Jun 2017 01:31:26 GMT
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 <harishjp@gmail.com>
Authored: Fri Jun 2 07:01:15 2017 +0530
Committer: Harish JP <harishjp@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));
   }
 
   /**


Mime
View raw message