You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by lo...@apache.org on 2008/09/13 10:27:07 UTC
svn commit: r694898 - in /hadoop/core/trunk: CHANGES.txt
src/mapred/org/apache/hadoop/mapred/JobHistory.java
src/mapred/org/apache/hadoop/mapred/JobTracker.java
Author: lohit
Date: Sat Sep 13 01:27:06 2008
New Revision: 694898
URL: http://svn.apache.org/viewvc?rev=694898&view=rev
Log:
HADOOP-4155. Use JobTracker's start time while initializing JobHistory's JobTracker Unique String. (lohit)
Modified:
hadoop/core/trunk/CHANGES.txt
hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java
hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobTracker.java
Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=694898&r1=694897&r2=694898&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Sat Sep 13 01:27:06 2008
@@ -540,6 +540,9 @@
HADOOP-3831. Very slow reading clients sometimes failed while reading.
(rangadi)
+ HADOOP-4155. Use JobTracker's start time while initializing JobHistory's
+ JobTracker Unique String. (lohit)
+
Release 0.18.1 - 2008-09-17
IMPROVEMENTS
Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java?rev=694898&r1=694897&r2=694898&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java (original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java Sat Sep 13 01:27:06 2008
@@ -69,8 +69,6 @@
private static final Pattern pattern = Pattern.compile(KEY + "=" + "\"" + VALUE + "\"");
- public static final String JOBTRACKER_START_TIME =
- String.valueOf(System.currentTimeMillis());
public static final int JOB_NAME_TRIM_LENGTH = 50;
private static String JOBTRACKER_UNIQUE_STRING = null;
private static String LOG_DIR = null;
@@ -114,17 +112,19 @@
* Initialize JobHistory files.
* @param conf Jobconf of the job tracker.
* @param hostname jobtracker's hostname
+ * @param jobTrackerStartTime jobtracker's start time
* @return true if intialized properly
* false otherwise
*/
- public static boolean init(JobConf conf, String hostname){
+ public static boolean init(JobConf conf, String hostname,
+ long jobTrackerStartTime){
try {
LOG_DIR = conf.get("hadoop.job.history.location" ,
"file:///" + new File(
System.getProperty("hadoop.log.dir")).getAbsolutePath()
+ File.separator + "history");
JOBTRACKER_UNIQUE_STRING = hostname + "_" +
- JOBTRACKER_START_TIME + "_";
+ String.valueOf(jobTrackerStartTime) + "_";
Path logDir = new Path(LOG_DIR);
FileSystem fs = logDir.getFileSystem(conf);
if (!fs.exists(logDir)){
Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobTracker.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobTracker.java?rev=694898&r1=694897&r2=694898&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobTracker.java (original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobTracker.java Sat Sep 13 01:27:06 2008
@@ -565,11 +565,13 @@
InetSocketAddress infoSocAddr = NetUtils.createSocketAddr(infoAddr);
String infoBindAddress = infoSocAddr.getHostName();
int tmpInfoPort = infoSocAddr.getPort();
+ this.startTime = System.currentTimeMillis();
infoServer = new StatusHttpServer("job", infoBindAddress, tmpInfoPort,
tmpInfoPort == 0, conf);
infoServer.setAttribute("job.tracker", this);
// initialize history parameters.
- boolean historyInitialized = JobHistory.init(conf, this.localMachine);
+ boolean historyInitialized = JobHistory.init(conf, this.localMachine,
+ this.startTime);
String historyLogDir = null;
FileSystem historyFS = null;
if (historyInitialized) {
@@ -579,8 +581,7 @@
infoServer.setAttribute("fileSys", historyFS);
}
infoServer.start();
-
- this.startTime = System.currentTimeMillis();
+
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmm");
trackerIdentifier = dateFormat.format(new Date());
@@ -640,7 +641,7 @@
// Initialize history again if it is not initialized
// because history was on dfs and namenode was in safemode.
if (!historyInitialized) {
- JobHistory.init(conf, this.localMachine);
+ JobHistory.init(conf, this.localMachine, this.startTime);
historyLogDir = conf.get("hadoop.job.history.location");
infoServer.setAttribute("historyLogDir", historyLogDir);
historyFS = new Path(historyLogDir).getFileSystem(conf);