Skip to content

Commit a48e8c9

Browse files
ashutoshcipherAshutosh Gupta
andauthored
MAPREDUCE-5608. Replace and deprecate mapred.tasktracker.indexcache.mb (#5014)
Co-authored-by: Ashutosh Gupta <ashugpt@amazon.com> Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
1 parent 04b31d7 commit a48e8c9

File tree

6 files changed

+22
-11
lines changed

6 files changed

+22
-11
lines changed

hadoop-common-project/hadoop-common/src/site/markdown/DeprecatedProperties.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ The following table lists the configuration property names that are deprecated i
208208
| mapred.task.profile.params | mapreduce.task.profile.params |
209209
| mapred.task.profile.reduces | mapreduce.task.profile.reduces |
210210
| mapred.task.timeout | mapreduce.task.timeout |
211-
| mapred.tasktracker.indexcache.mb | mapreduce.tasktracker.indexcache.mb |
211+
| mapred.tasktracker.indexcache.mb | mapreduce.reduce.shuffle.indexcache.mb |
212+
| mapreduce.tasktracker.indexcache.mb | mapreduce.reduce.shuffle.indexcache.mb |
212213
| mapred.tasktracker.map.tasks.maximum | mapreduce.tasktracker.map.tasks.maximum |
213214
| mapred.tasktracker.memory\_calculator\_plugin | mapreduce.tasktracker.resourcecalculatorplugin |
214215
| mapred.tasktracker.memorycalculatorplugin | mapreduce.tasktracker.resourcecalculatorplugin |

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/IndexCache.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import java.util.concurrent.atomic.AtomicInteger;
2424

2525
import org.apache.hadoop.fs.Path;
26-
import org.apache.hadoop.mapreduce.server.tasktracker.TTConfig;
26+
import org.apache.hadoop.mapreduce.MRJobConfig;
2727
import org.slf4j.Logger;
2828
import org.slf4j.LoggerFactory;
2929

@@ -43,7 +43,7 @@ class IndexCache {
4343
public IndexCache(JobConf conf) {
4444
this.conf = conf;
4545
totalMemoryAllowed =
46-
conf.getInt(TTConfig.TT_INDEX_CACHE, 10) * 1024 * 1024;
46+
conf.getInt(MRJobConfig.SHUFFLE_INDEX_CACHE, 10) * 1024 * 1024;
4747
LOG.info("IndexCache created with max memory = " + totalMemoryAllowed);
4848
}
4949

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/MRJobConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,8 @@ public interface MRJobConfig {
577577
public static final String MAX_SHUFFLE_FETCH_HOST_FAILURES = "mapreduce.reduce.shuffle.max-host-failures";
578578
public static final int DEFAULT_MAX_SHUFFLE_FETCH_HOST_FAILURES = 5;
579579

580+
public static final String SHUFFLE_INDEX_CACHE = "mapreduce.reduce.shuffle.indexcache.mb";
581+
580582
public static final String REDUCE_SKIP_INCR_PROC_COUNT = "mapreduce.reduce.skip.proc-count.auto-incr";
581583

582584
public static final String REDUCE_SKIP_MAXGROUPS = "mapreduce.reduce.skip.maxgroups";

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/server/tasktracker/TTConfig.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
@InterfaceStability.Evolving
3030
public interface TTConfig extends MRConfig {
3131

32+
/**
33+
* @deprecated Use
34+
* {@link org.apache.hadoop.mapreduce.MRJobConfig#SHUFFLE_INDEX_CACHE}
35+
* instead
36+
*/
37+
@Deprecated
3238
public static final String TT_INDEX_CACHE =
3339
"mapreduce.tasktracker.indexcache.mb";
3440
public static final String TT_MAP_SLOTS =

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/util/ConfigUtil.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ private static void addDeprecatedKeys() {
8080
JTConfig.JT_TASKCACHE_LEVELS),
8181
new DeprecationDelta("mapred.job.tracker.retire.jobs",
8282
JTConfig.JT_RETIREJOBS),
83-
new DeprecationDelta("mapred.tasktracker.indexcache.mb",
84-
TTConfig.TT_INDEX_CACHE),
8583
new DeprecationDelta("mapred.tasktracker.map.tasks.maximum",
8684
TTConfig.TT_MAP_SLOTS),
8785
new DeprecationDelta("mapred.tasktracker.memory_calculator_plugin",
@@ -290,6 +288,10 @@ private static void addDeprecatedKeys() {
290288
MRJobConfig.REDUCE_LOG_LEVEL),
291289
new DeprecationDelta("mapreduce.job.counters.limit",
292290
MRJobConfig.COUNTERS_MAX_KEY),
291+
new DeprecationDelta("mapred.tasktracker.indexcache.mb",
292+
MRJobConfig.SHUFFLE_INDEX_CACHE),
293+
new DeprecationDelta("mapreduce.tasktracker.indexcache.mb",
294+
MRJobConfig.SHUFFLE_INDEX_CACHE),
293295
new DeprecationDelta("jobclient.completion.poll.interval",
294296
Job.COMPLETION_POLL_INTERVAL_KEY),
295297
new DeprecationDelta("jobclient.progress.monitor.poll.interval",

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapred/TestIndexCache.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import org.apache.hadoop.fs.Path;
3131
import org.apache.hadoop.fs.FSDataOutputStream;
3232
import org.apache.hadoop.security.UserGroupInformation;
33-
import org.apache.hadoop.mapreduce.server.tasktracker.TTConfig;
33+
import org.apache.hadoop.mapreduce.MRJobConfig;
3434

3535
import org.junit.Before;
3636
import org.junit.Test;
@@ -56,7 +56,7 @@ public void testLRCPolicy() throws Exception {
5656
r.setSeed(seed);
5757
System.out.println("seed: " + seed);
5858
fs.delete(p, true);
59-
conf.setInt(TTConfig.TT_INDEX_CACHE, 1);
59+
conf.setInt(MRJobConfig.SHUFFLE_INDEX_CACHE, 1);
6060
final int partsPerMap = 1000;
6161
final int bytesPerFile = partsPerMap * 24;
6262
IndexCache cache = new IndexCache(conf);
@@ -127,7 +127,7 @@ public void testLRCPolicy() throws Exception {
127127
public void testBadIndex() throws Exception {
128128
final int parts = 30;
129129
fs.delete(p, true);
130-
conf.setInt(TTConfig.TT_INDEX_CACHE, 1);
130+
conf.setInt(MRJobConfig.SHUFFLE_INDEX_CACHE, 1);
131131
IndexCache cache = new IndexCache(conf);
132132

133133
Path f = new Path(p, "badindex");
@@ -159,7 +159,7 @@ public void testBadIndex() throws Exception {
159159
@Test
160160
public void testInvalidReduceNumberOrLength() throws Exception {
161161
fs.delete(p, true);
162-
conf.setInt(TTConfig.TT_INDEX_CACHE, 1);
162+
conf.setInt(MRJobConfig.SHUFFLE_INDEX_CACHE, 1);
163163
final int partsPerMap = 1000;
164164
final int bytesPerFile = partsPerMap * 24;
165165
IndexCache cache = new IndexCache(conf);
@@ -205,7 +205,7 @@ public void testRemoveMap() throws Exception {
205205
// fails with probability of 100% on code before MAPREDUCE-2541,
206206
// so it is repeatable in practice.
207207
fs.delete(p, true);
208-
conf.setInt(TTConfig.TT_INDEX_CACHE, 10);
208+
conf.setInt(MRJobConfig.SHUFFLE_INDEX_CACHE, 10);
209209
// Make a big file so removeMapThread almost surely runs faster than
210210
// getInfoThread
211211
final int partsPerMap = 100000;
@@ -251,7 +251,7 @@ public void run() {
251251
@Test
252252
public void testCreateRace() throws Exception {
253253
fs.delete(p, true);
254-
conf.setInt(TTConfig.TT_INDEX_CACHE, 1);
254+
conf.setInt(MRJobConfig.SHUFFLE_INDEX_CACHE, 1);
255255
final int partsPerMap = 1000;
256256
final int bytesPerFile = partsPerMap * 24;
257257
final IndexCache cache = new IndexCache(conf);

0 commit comments

Comments
 (0)