From bfc09a2a7bd6874f9b903ff4138ce6e4cc218f12 Mon Sep 17 00:00:00 2001 From: Naganarasimha Date: Tue, 25 Oct 2016 04:47:06 +0530 Subject: [PATCH] MAPREDUCE-6772. Add MR Job Configurations for Containers reuse. Contributed by Devaraj K. --- .../apache/hadoop/mapreduce/MRJobConfig.java | 40 +++++++++++++++++ .../src/main/resources/mapred-default.xml | 45 +++++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/MRJobConfig.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/MRJobConfig.java index a90c58dd28b..135de0260ad 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/MRJobConfig.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/MRJobConfig.java @@ -1295,4 +1295,44 @@ public interface MRJobConfig { */ @Unstable String INPUT_FILE_MANDATORY_PREFIX = "mapreduce.job.input.file.must."; + + /** + * Whether to enable the RM Container reuse or not. + */ + String MR_AM_CONTAINER_REUSE_ENABLED = MR_PREFIX + "container.reuse.enabled"; + boolean DEFAULT_MR_AM_CONTAINER_REUSE_ENABLED = false; + + /** + * No of times can each container(Map Task) reuse. The Default value is -1, + * which implies there is no limit for reusing the container for map tasks. + */ + String MR_AM_CONTAINER_REUSE_MAX_MAPTASKS = MR_PREFIX + + "container.reuse.max-maptasks"; + int DEFAULT_MR_AM_CONTAINER_REUSE_MAX_MAPTASKS = -1; + + /** + * No of tasks can each container(Reduce Task) reuse. The Default value is -1, + * which implies there is no limit for reusing the container for reduce tasks. + */ + String MR_AM_CONTAINER_REUSE_MAX_REDUCETASKS = MR_PREFIX + + "container.reuse.max-reducetasks"; + int DEFAULT_MR_AM_CONTAINER_REUSE_MAX_REDUCETASKS = -1; + + /** + * No of Max Map task containers can be reused at any point of time. The + * Default value is -1, which implies there is no limit of having map task + * containers for reuse at any time. + */ + String MR_AM_CONTAINER_REUSE_MAX_MAPTASKCONTAINERS = MR_PREFIX + + "container.reuse.max-maptaskcontainers"; + int DEFAULT_MR_AM_CONTAINER_REUSE_MAX_MAPTASKCONTAINERS = -1; + + /** + * No Of Max Reduce Task Containers can be reused at any point of time. The + * Default value is -1, which implies there is no limit of having reduce task + * containers for reuse at any time. + */ + String MR_AM_CONTAINER_REUSE_MAX_REDUCETASKCONTAINERS = MR_PREFIX + + "container.reuse.max-reducetaskcontainers"; + int DEFAULT_MR_AM_CONTAINER_REUSE_MAX_REDUCETASKCONTAINERS = -1; } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml index 844c91c5ce0..ebb728a15f5 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml @@ -2231,4 +2231,49 @@ + + + Whether to enable the RM Container reuse or not. + + yarn.app.mapreduce.container.reuse.enabled + false + + + + + No of times can each container(Map Task) reuse. The Default value is -1, + which implies there is no limit for reusing the container for map tasks. + + yarn.app.mapreduce.container.reuse.max-maptasks + -1 + + + + + No of tasks can each container(Reduce Task) reuse. The Default value is -1, + which implies there is no limit for reusing the container for reduce tasks. + + yarn.app.mapreduce.container.reuse.max-reducetasks + -1 + + + + + No of Max Map task containers can be reused at any point of time. The + Default value is -1, which implies there is no limit of having map task + containers for reuse at any time. + + yarn.app.mapreduce.container.reuse.max-maptaskcontainers + -1 + + + + + No Of Max Reduce Task Containers can be reused at any point of time. The + Default value is -1, which implies there is no limit of having reduce task + containers for reuse at any time. + + yarn.app.mapreduce.container.reuse.max-reducetaskcontainers + -1 +