Skip to content

Commit 5670e89

Browse files
committed
MAPREDUCE-7101. Add config parameter to allow JHS to alway scan user dir irrespective of modTime. (Thomas Marquardt via asuresh)
1 parent aeaf9fe commit 5670e89

File tree

3 files changed

+23
-3
lines changed
  • hadoop-mapreduce-project/hadoop-mapreduce-client

3 files changed

+23
-3
lines changed

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/JHAdminConfig.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,13 @@ public class JHAdminConfig {
6161
MR_HISTORY_PREFIX + "cleaner.interval-ms";
6262
public static final long DEFAULT_MR_HISTORY_CLEANER_INTERVAL_MS =
6363
1 * 24 * 60 * 60 * 1000l; //1 day
64-
65-
64+
65+
/** Always scan user dir, irrespective of dir modification time.*/
66+
public static final String MR_HISTORY_ALWAYS_SCAN_USER_DIR =
67+
MR_HISTORY_PREFIX + "always-scan-user-dir";
68+
public static final boolean DEFAULT_MR_HISTORY_ALWAYS_SCAN_USER_DIR =
69+
false;
70+
6671
/** The number of threads to handle client API requests.*/
6772
public static final String MR_HISTORY_CLIENT_THREAD_COUNT =
6873
MR_HISTORY_PREFIX + "client.thread-count";

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml

+9
Original file line numberDiff line numberDiff line change
@@ -1774,6 +1774,15 @@
17741774
</description>
17751775
</property>
17761776

1777+
<property>
1778+
<name>mapreduce.jobhistory.always-scan-user-dir</name>
1779+
<value>false</value>
1780+
<description>Some Cloud FileSystems do not currently update the
1781+
modification time of directories. To support these filesystems, this
1782+
configuration value should be set to 'true'.
1783+
</description>
1784+
</property>
1785+
17771786
<property>
17781787
<name>mapreduce.jobhistory.done-dir</name>
17791788
<value>${yarn.app.mapreduce.am.staging-dir}/history/done</value>

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryFileManager.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,13 @@ public synchronized void scanIfNeeded(FileStatus fs) {
324324
// so we need to have additional check.
325325
// Note: modTime (X second Y millisecond) could be casted to X second or
326326
// X+1 second.
327-
if (modTime != newModTime
327+
// MAPREDUCE-7101: Some Cloud FileSystems do not currently update the
328+
// modification time of directories. For these, we scan every time if
329+
// the 'alwaysScan' is true.
330+
boolean alwaysScan = conf.getBoolean(
331+
JHAdminConfig.MR_HISTORY_ALWAYS_SCAN_USER_DIR,
332+
JHAdminConfig.DEFAULT_MR_HISTORY_ALWAYS_SCAN_USER_DIR);
333+
if (alwaysScan || modTime != newModTime
328334
|| (scanTime/1000) == (modTime/1000)
329335
|| (scanTime/1000 + 1) == (modTime/1000)) {
330336
// reset scanTime before scanning happens

0 commit comments

Comments
 (0)