svn merge -c 1382088 FIXES: MAPREDUCE-4629. Remove JobHistory.DEBUG_MODE (Karthik Kambatla via bobby)
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1382089 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
69d9fa75bc
commit
ebb1a16f62
|
@ -67,6 +67,8 @@ Branch-2 ( Unreleased changes )
|
||||||
MAPREDUCE-4610. Support deprecated mapreduce.job.counters.limit property in
|
MAPREDUCE-4610. Support deprecated mapreduce.job.counters.limit property in
|
||||||
MR2. (tomwhite)
|
MR2. (tomwhite)
|
||||||
|
|
||||||
|
MAPREDUCE-4629. Remove JobHistory.DEBUG_MODE (Karthik Kambatla via bobby)
|
||||||
|
|
||||||
Release 2.1.0-alpha - Unreleased
|
Release 2.1.0-alpha - Unreleased
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -61,11 +61,6 @@ public class JHAdminConfig {
|
||||||
MR_HISTORY_PREFIX + "datestring.cache.size";
|
MR_HISTORY_PREFIX + "datestring.cache.size";
|
||||||
public static final int DEFAULT_MR_HISTORY_DATESTRING_CACHE_SIZE = 200000;
|
public static final int DEFAULT_MR_HISTORY_DATESTRING_CACHE_SIZE = 200000;
|
||||||
|
|
||||||
//TODO REMOVE debug-mode
|
|
||||||
/** Equivalent to 0.20 mapreduce.jobhistory.debug.mode */
|
|
||||||
public static final String MR_HISTORY_DEBUG_MODE =
|
|
||||||
MR_HISTORY_PREFIX + "debug-mode";
|
|
||||||
|
|
||||||
/** Path where history files should be stored for DONE jobs. **/
|
/** Path where history files should be stored for DONE jobs. **/
|
||||||
public static final String MR_HISTORY_DONE_DIR =
|
public static final String MR_HISTORY_DONE_DIR =
|
||||||
MR_HISTORY_PREFIX + "done-dir";
|
MR_HISTORY_PREFIX + "done-dir";
|
||||||
|
|
|
@ -343,20 +343,19 @@ public class JobHistoryUtils {
|
||||||
/**
|
/**
|
||||||
* Gets the timestamp component based on millisecond time.
|
* Gets the timestamp component based on millisecond time.
|
||||||
* @param millisecondTime
|
* @param millisecondTime
|
||||||
* @param debugMode
|
|
||||||
* @return the timestamp component based on millisecond time
|
* @return the timestamp component based on millisecond time
|
||||||
*/
|
*/
|
||||||
public static String timestampDirectoryComponent(long millisecondTime, boolean debugMode) {
|
public static String timestampDirectoryComponent(long millisecondTime) {
|
||||||
Calendar timestamp = Calendar.getInstance();
|
Calendar timestamp = Calendar.getInstance();
|
||||||
timestamp.setTimeInMillis(millisecondTime);
|
timestamp.setTimeInMillis(millisecondTime);
|
||||||
String dateString = null;
|
String dateString = null;
|
||||||
dateString = String.format(
|
dateString = String
|
||||||
TIMESTAMP_DIR_FORMAT,
|
.format(TIMESTAMP_DIR_FORMAT,
|
||||||
timestamp.get(Calendar.YEAR),
|
timestamp.get(Calendar.YEAR),
|
||||||
// months are 0-based in Calendar, but people will expect January
|
// months are 0-based in Calendar, but people will expect January to
|
||||||
// to be month #1.
|
// be month #1.
|
||||||
timestamp.get(debugMode ? Calendar.HOUR : Calendar.MONTH) + 1,
|
timestamp.get(Calendar.MONTH) + 1,
|
||||||
timestamp.get(debugMode ? Calendar.MINUTE : Calendar.DAY_OF_MONTH));
|
timestamp.get(Calendar.DAY_OF_MONTH));
|
||||||
dateString = dateString.intern();
|
dateString = dateString.intern();
|
||||||
return dateString;
|
return dateString;
|
||||||
}
|
}
|
||||||
|
|
|
@ -358,7 +358,6 @@ public class HistoryFileManager extends AbstractService {
|
||||||
|
|
||||||
private Configuration conf;
|
private Configuration conf;
|
||||||
|
|
||||||
private boolean debugMode;
|
|
||||||
private String serialNumberFormat;
|
private String serialNumberFormat;
|
||||||
|
|
||||||
private Path doneDirPrefixPath = null; // folder for completed jobs
|
private Path doneDirPrefixPath = null; // folder for completed jobs
|
||||||
|
@ -379,8 +378,7 @@ public class HistoryFileManager extends AbstractService {
|
||||||
public void init(Configuration conf) {
|
public void init(Configuration conf) {
|
||||||
this.conf = conf;
|
this.conf = conf;
|
||||||
|
|
||||||
debugMode = conf.getBoolean(JHAdminConfig.MR_HISTORY_DEBUG_MODE, false);
|
int serialNumberLowDigits = 3;
|
||||||
int serialNumberLowDigits = debugMode ? 1 : 3;
|
|
||||||
serialNumberFormat = ("%0"
|
serialNumberFormat = ("%0"
|
||||||
+ (JobHistoryUtils.SERIAL_NUMBER_DIRECTORY_DIGITS + serialNumberLowDigits)
|
+ (JobHistoryUtils.SERIAL_NUMBER_DIRECTORY_DIGITS + serialNumberLowDigits)
|
||||||
+ "d");
|
+ "d");
|
||||||
|
@ -780,8 +778,8 @@ public class HistoryFileManager extends AbstractService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Path canonicalHistoryLogPath(JobId id, long millisecondTime) {
|
private Path canonicalHistoryLogPath(JobId id, long millisecondTime) {
|
||||||
String timestampComponent = JobHistoryUtils.timestampDirectoryComponent(
|
String timestampComponent = JobHistoryUtils
|
||||||
millisecondTime, debugMode);
|
.timestampDirectoryComponent(millisecondTime);
|
||||||
return new Path(doneDirPrefixPath, JobHistoryUtils.historyLogSubdirectory(
|
return new Path(doneDirPrefixPath, JobHistoryUtils.historyLogSubdirectory(
|
||||||
id, timestampComponent, serialNumberFormat));
|
id, timestampComponent, serialNumberFormat));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue